HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: Takaji on 2023-01-28 14:07:53

Title: Modifying tags causes foo_playcount %added% tag to change
Post by: Takaji on 2023-01-28 14:07:53
I'm not exactly sure when this behaviour started (possibly when I switched to foobar2000 v2.0?), but I've noticed that if I modify the %album% tag of an album, then %added% also changes to the date that I modified the tags - I assume because the database sees this as a new entry. Is there a way to disable/fix this?

I thought maybe the playback statistics database would've relied on another way of identifying a track/album instead of by the tags - perhaps by a hash or something like this?

I noticed a typo in an album title, and now %added% shows that the album was added to my library today, instead of back in 2018. I have an autoplaylist which organises my music by %added%, and this then gets messed up.
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: anamorphic on 2023-01-28 14:25:55
Sounds like a bug, reported in bugs topic - see last quoted text / reply by Peter here (https://hydrogenaud.io/index.php/topic,122847.msg1020952.html#msg1020952).

Edit: Though supposedly it was addressed in Beta 21 (https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Version_2.0_Beta_Change_Log#Beta_21) -

Quote
Worked around ages old problem with external changes to file tags causing loss of foo_playcount data (needs new foo_playcount).

Maybe a new bug... Have you updated foo_playcount?
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: Takaji on 2023-01-28 16:07:26
I can confirm that this is happening with 2.0 beta 24 and foo_playcount 3.1.3.

Steps to reproduce:
1. Change the title of an album (%album%) in the media library (in this case I added "(Test)" to the end of the album name)
2. Playback Statistics field will show an Added date that reflects when you changed the album name.

Changing the album name back to its original value restores the correct playback statistics.
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: Takaji on 2023-02-11 17:31:37
Even stranger is that one of these files in question will show one date in the properties window of foobar2000 and another value in metadb.sqlite.

(https://i.gyazo.com/bfb86a2d523738f55b5e00900060dd9d.png) (https://i.gyazo.com/bfb86a2d523738f55b5e00900060dd9d.png)

(https://i.gyazo.com/5505668bf818a6325767acbc9ef602bc.png) (https://i.gyazo.com/5505668bf818a6325767acbc9ef602bc.png)

The value in foobar2000 properties dialog for this track's Playback Statistics "Added" date is 2023-01-28 14:52:27, while dateAdded in metadb.sqlite is 129732389459825045, which converts to 2012-02-09 05:29:05.

How come the value from metadb.sqlite is not being read by the Playback Statistics component? Am I missing something?
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: marc2k3 on 2023-02-11 17:55:02
Only native fb2k playback statistics from Beta1 - Beta17 were stored in a human readable format in metdab.sqlite. It's obsolete as of Beta18.

Using foo_playcount in Beta18 or later, that data *should* have been imported in to a new table but that data is serialised and totally unreadable.
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: Takaji on 2023-02-11 20:10:30
Thanks for pointing that out, Marc. I guess that puts an end to that. I used to be able to open the database with a SQL editor and fix these issues with the date added timestamp changing, but now I can't, it seems?

I suppose the solution is to stop using the 2.0 beta until this bug in the original post (if it is a bug) is addressed - if that does indeed happen.
Title: Re: Modifying tags causes foo_playcount %added% tag to change
Post by: Takaji on 2023-02-12 12:31:14
I forgot that it's still possible to use Library > Playback Statistics > Export statistics to get a XML copy of the playback statistics, which includes Added and AddedFriendly values. It's then fairly straightforward to adjust an added date by converting the AddedFriendly value to LDAP/FILETIME (https://www.epochconverter.com/ldap) format.