2015-10-24, 21:39
I'm guessing that the music library data model has moved on since some of these functions (and their related nodes) were designed. I think we need to review the queries we use to get the recently played or added things.
I started looking at them because now the song.strArtists field is not always just a concantonated string denormalisation of the artist names in the song_artist table, we need to query the song_artist table as well if trying to return accurate artist data not just a description (same for albums and album_artist). But there are other issues.
a) Recently added songs or albums should be determined using the song.dateAdded field. Currently it uses song or album ID, presuming that the most recent have the highest ID. This isn't always the case, and as a result the list of recently added songs displayed is not in date added order (and not always the most recent).
It makes sense to say that the date an album is added (album does not have a date added field) is the last date that a song from that album was added.
b) Recently played.... when do we consider something to be played? Personally I would like to flag a song (last played date and playcount) when I have started to play it regardless of if I got to the end. Currently we do the opposite, unless you get to the end it does not count.
For an album the play count and last played date are determined from the songs. But again it is pessimistic in that all the songs must be played before an album is considered to be played - albumview.iTimesPlayed = min(song.iTimesPlayed). Hence the silly situation that if there is one song that you never listen to completely, maybe you skip the end, that album is never listed as played!
Personally I would like to flag an album as played if I started playing just one song. Am I odd?
Perhaps there is a requirement for both started and completed approaches? What music have a completely listened to lots, or what have I never even sampled?
Changing for a) is necessary, correcting GetRecentlyAddedAlbumSongs and GetRecentlyAddedAlbums.
Just wondering what people's thoughts are about b) changing when song.lastplayed and iTimesPlayed is set, how albumview.iTimesPlayed is calculated (max(song.iTimesPlayed) and the results of GetTop100Albums, GetTop100AlbumSongs, GetRecentlyPlayedAlbums, GetRecentlyPlayedAlbumSongs.
I started looking at them because now the song.strArtists field is not always just a concantonated string denormalisation of the artist names in the song_artist table, we need to query the song_artist table as well if trying to return accurate artist data not just a description (same for albums and album_artist). But there are other issues.
a) Recently added songs or albums should be determined using the song.dateAdded field. Currently it uses song or album ID, presuming that the most recent have the highest ID. This isn't always the case, and as a result the list of recently added songs displayed is not in date added order (and not always the most recent).
It makes sense to say that the date an album is added (album does not have a date added field) is the last date that a song from that album was added.
b) Recently played.... when do we consider something to be played? Personally I would like to flag a song (last played date and playcount) when I have started to play it regardless of if I got to the end. Currently we do the opposite, unless you get to the end it does not count.
For an album the play count and last played date are determined from the songs. But again it is pessimistic in that all the songs must be played before an album is considered to be played - albumview.iTimesPlayed = min(song.iTimesPlayed). Hence the silly situation that if there is one song that you never listen to completely, maybe you skip the end, that album is never listed as played!
Personally I would like to flag an album as played if I started playing just one song. Am I odd?
Perhaps there is a requirement for both started and completed approaches? What music have a completely listened to lots, or what have I never even sampled?
Changing for a) is necessary, correcting GetRecentlyAddedAlbumSongs and GetRecentlyAddedAlbums.
Just wondering what people's thoughts are about b) changing when song.lastplayed and iTimesPlayed is set, how albumview.iTimesPlayed is calculated (max(song.iTimesPlayed) and the results of GetTop100Albums, GetTop100AlbumSongs, GetRecentlyPlayedAlbums, GetRecentlyPlayedAlbumSongs.