Syncing iPhone doesn't update Last Played [#18673]

Help improve MediaMonkey 5 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Syncing iPhone doesn't update Last Played [#18673]

Post by sail2fast »

MMW 5.0.2. 2526 with Iphone 6s running OS 15. When I sync the phone, "Last Played" is not synced. Actually, a couple played songs have the correct "Last Played", but hundreds of other songs are not updated in MMW.

Note that I can see the correct "Last Played" date when I view the Music list of the Iphone within MMW.

BTW, I notice that most of the played songs on the Iphone show a correct "Last Played" date, but "Played #" = 0. The few songs that updated the played # in MMW do have a positive "Played #".

Syncing Last Played is very important for me--this broke recently upon upgrading the iPhone to OS15...
Lowlander
Posts: 56680
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Syncing iPhone doesn't update Last Played

Post by Lowlander »

Is there a pattern to those that do have correct Last Played? Could they have been played before or after iOS 15 or MediaMonkey updates?
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: Syncing iPhone doesn't update Last Played

Post by Ludek »

Note that I can see the correct "Last Played" date when I view the Music list of the Iphone within MMW.
If you are seeing them in MMW then I guess that _syncing_ the device does update the playcount/lastplayed/rating in MMW, isn't it?
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played

Post by sail2fast »

More info: Syncing the phone to MMW does not update "last played" in the MMW library unless the "played count" is non zero. I played a few songs just now for testing--the "played #" correctly increments and the 'last played' is correctly updated.

However, most songs that have been played (except a couple I just played in testing) show a played # = 0 in MMW. I installed an application on my iphone ("Song Stats")--this application correctly shows the actual played count and last played for all the songs on the iphone.

So Media Monkey is not retrieving the played # from the same location as the iPhone application "Song Stats".
And MMW is apparently not syncing "last played" if it (incorrectly) thinks the 'played #' is 0.
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played

Post by sail2fast »

Also: all the songs played have been after the upgrade to MM5 and OS 15.
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: Syncing iPhone doesn't update Last Played

Post by Ludek »

Checking it now and MM5 is reading the Played# value from MediaLibrary.sqlitedb file on the iPhone.

Table 'item_stats' and column 'play_count_recent', during sync it increases the value in MM5 by the 'play_count_recent' value.

There is also column 'play_count_user' and this is where probably the "Song stats" takes the values, see:
https://www.dropbox.com/s/y3mxzyuf65re7 ... 4.png?dl=0

'play_count_recent' is cleared after the Played# is synced with MM5.
So that's explains the difference.

i.e. another app (or another MM instance) could already pick up the 'play_count_recent' value and clear it.
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played

Post by sail2fast »

Thanks, that is very helpful. I did cancel an auto-sync, so perhaps the 'play_count_recent' was reset but the other values were undone during the cancel.

Is there any easy way I can increment 'play_count_recent' to force an update of last_played or otherwise get these to update?
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: Syncing iPhone doesn't update Last Played

Post by Ludek »

Actually seeing that MediaLibrary.sqlitedb can potentially get out of sync with iTunesCDB this way (because of cleared 'play_count_recent' value).

I guess I will have to change the mechanism to rather always take the 'play_count_user' value and always use this value also when viewing the tracks in MM5 interface (Devices & Services > iPod > Music list)

Also seeing that MM5 already remembers the inital played# value synced to the device, so I could always use the 'play_count_user' and decrease it by the initial played# value when the track was synced from MM5 > iPod and update both the values after the sync.

i.e.
1) during MM5 > iPod sync use:
played_value_when_track_was_synced_to_iPhone = MM5.track.play_count

2) during iPod > MM5 sync use:
MM5.track.play_count = MM5.track.play_count + (iPod.play_count_user - played_value_when_track_was_synced_to_iPhone)
played_value_when_track_was_synced_to_iPhone = iPod.play_count_user;

Entered as: https://www.ventismedia.com/mantis/view.php?id=18673

EDIT: As for the current workaround: Yes, bulk increasing the 'play_count_recent' is possible, you can use iMazing app to download the MediaLibrary.sqlite from the iPhone and then open it in SQLite studio and update the 'play_count_recent' by SQL query like:

Code: Select all

UPDATE item_stats SET play_count_recent = 1 WHERE play_count_user > 0
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played [#18673]

Post by sail2fast »

Happy news: I was able to use DB Browser to force the 'play_count_recent=1' for all the songs on my iphone that had a 'last_played' date. Then I re-synced in MMW5 and all the played# and 'last_played' were correctly updated. (and AnyTrans to move the MediaLibrary.sqlitedb file back and forth). This workaround saved me a lot of lost data towards a playlist I'm working on.

Thanks for all your assistance.
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: Syncing iPhone doesn't update Last Played [#18673]

Post by Ludek »

Great! ;-)
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played [#18673]

Post by sail2fast »

I just got caught out on this bug again. Any chance of getting it fixed?

Thanks!
sail2fast
Posts: 7
Joined: Sun Nov 22, 2020 3:39 pm

Re: Syncing iPhone doesn't update Last Played [#18673]

Post by sail2fast »

Note that the previous workaround of setting 'play_count_recent' to 1 is no longer working. I haven't figured out any way to get 'Last Played' or 'play count' to sync from the iphone to media monkey database
Post Reply