mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 15:15:57 -05:00
Merge pull request #625 from chme/spotify_metadata
[spotify] Set track fields "time added" and "time modified"
This commit is contained in:
commit
a8d3a045f2
@ -1282,6 +1282,9 @@ map_track_to_mfi(struct media_file_info *mfi, const struct spotify_track *track,
|
|||||||
mfi->path = strdup(track->uri);
|
mfi->path = strdup(track->uri);
|
||||||
mfi->fname = strdup(track->uri);
|
mfi->fname = strdup(track->uri);
|
||||||
|
|
||||||
|
mfi->time_modified = track->mtime;
|
||||||
|
mfi->time_added = track->mtime;
|
||||||
|
|
||||||
if (album)
|
if (album)
|
||||||
{
|
{
|
||||||
mfi->album_artist = safe_strdup(album->artist);
|
mfi->album_artist = safe_strdup(album->artist);
|
||||||
@ -1289,7 +1292,6 @@ map_track_to_mfi(struct media_file_info *mfi, const struct spotify_track *track,
|
|||||||
mfi->genre = safe_strdup(album->genre);
|
mfi->genre = safe_strdup(album->genre);
|
||||||
mfi->compilation = album->is_compilation;
|
mfi->compilation = album->is_compilation;
|
||||||
mfi->year = album->release_year;
|
mfi->year = album->release_year;
|
||||||
mfi->time_modified = album->mtime;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1303,8 +1305,6 @@ map_track_to_mfi(struct media_file_info *mfi, const struct spotify_track *track,
|
|||||||
mfi->compilation = true;
|
mfi->compilation = true;
|
||||||
else
|
else
|
||||||
mfi->compilation = track->is_compilation;
|
mfi->compilation = track->is_compilation;
|
||||||
|
|
||||||
mfi->time_modified = time(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(virtual_path, PATH_MAX, "/spotify:/%s/%s/%s", mfi->album_artist, mfi->album, mfi->title);
|
snprintf(virtual_path, PATH_MAX, "/spotify:/%s/%s/%s", mfi->album_artist, mfi->album, mfi->title);
|
||||||
@ -1407,6 +1407,7 @@ saved_album_add(json_object *item, int index, int total, void *arg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
parse_metadata_track(jsontrack, &track);
|
parse_metadata_track(jsontrack, &track);
|
||||||
|
track.mtime = album.mtime;
|
||||||
|
|
||||||
ret = track_add(&track, &album, NULL, dir_id);
|
ret = track_add(&track, &album, NULL, dir_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user