summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 304a511c37..91ca1f640a 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -2010,6 +2010,31 @@ int playlist_get_resume_info(int *resume_index)
2010 return 0; 2010 return 0;
2011} 2011}
2012 2012
2013/* Update resume info for current playing song. Returns -1 on error. */
2014int playlist_update_resume_info(const struct mp3entry* id3)
2015{
2016 struct playlist_info* playlist = &current_playlist;
2017
2018 if (id3)
2019 {
2020 if (global_settings.resume_index != playlist->index ||
2021 global_settings.resume_offset != id3->offset)
2022 {
2023 global_settings.resume_index = playlist->index;
2024 global_settings.resume_offset = id3->offset;
2025 settings_save();
2026 }
2027 }
2028 else
2029 {
2030 global_settings.resume_index = -1;
2031 global_settings.resume_offset = -1;
2032 settings_save();
2033 }
2034
2035 return 0;
2036}
2037
2013/* Returns index of current playing track for display purposes. This value 2038/* Returns index of current playing track for display purposes. This value
2014 should not be used for resume purposes as it doesn't represent the actual 2039 should not be used for resume purposes as it doesn't represent the actual
2015 index into the playlist */ 2040 index into the playlist */