-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field comparison problems #2942
Comments
Hi! Are you interested in diving in to see if you can propose potential solutions? |
At least for acoustid_fingerprint, it seems that Even though the acoustid_fingerprint column is declared as TEXT, it seems sqlite is loosely-typed and BLOBs can still be stored there. I'll add a commit that converts the byte strings over to strings soon. |
For bpm, the bpm field is sometimes being stored as a float in the library.
The AcousticBrainz plugin is not properly converting the retrieved floating-point bpm into an integer. (Maybe the defined type of bpm for beets should be float?)
|
For bitrate, it seems that the file metadata is not to the same precision as the library metadata. So a bitrate of Again, I suspect this is due to the AcousticBrainz plugin not casting values from the database results to the proper types/precisions. |
@sampsyo It seems that these problems could be prevented by casting values to the appropriate type on assignment to a model. I can try to flesh out the |
Yes; thanks for looking into it—enhancing the normalization for at least some types would probably be a good idea. It would be important to be very careful with this, though, since changes to these types can have pervasive effects on every operation in beets. Maybe we can start with one or two types and thoroughly test things out. For the fingerprint in particular, it’s not 100% clear to me whether the right type is a string or a binary blob. |
Found this bugreport while trying to list my library using
|
@minusf This is related but a bit different. You probably want |
this works, excellent. perhaps would be nice addition to the querying section of the docs :} |
Sure! If you can think of a good place to put it, please consider sending a pull request. |
Since pyacoustid returns the fingerprint as bytes (and thus causes the database to store a bytes/BLOB object), but the tag value is a string, the acoustid_fingerprint tag always causes file change when using beet's "write" command, even if the actual value didn't change. Issue beetbox#2942 describes the problem. This commit fixes that issue for newly imported/fingerprinted files. However, you still need to change the type of all acoustid_fingerprint fields that are already present in the database: $ sqlite3 beets.db SQLite version 3.26.0 2018-12-01 12:34:55 Enter ".help" for usage hints. sqlite> UPDATE items SET acoustid_fingerprint = CAST(acoustid_fingerprint AS TEXT);
Since pyacoustid returns the fingerprint as bytes (and thus causes the database to store a bytes/BLOB object), but the tag value is a string, the acoustid_fingerprint tag always causes file change when using beet's "write" command, even if the actual value didn't change. Issue beetbox#2942 describes the problem. This commit fixes that issue for newly imported/fingerprinted files. However, you still need to change the type of all acoustid_fingerprint fields that are already present in the database: $ sqlite3 beets.db SQLite version 3.26.0 2018-12-01 12:34:55 Enter ".help" for usage hints. sqlite> UPDATE items SET acoustid_fingerprint = CAST(acoustid_fingerprint AS TEXT);
hi, i just use the latest commit, which contain #3097 but it still register this diff error on both bpm and pyacoustid_fingerprint. a temporary solution i made is this branch https://github.com/rachmadaniHaryono/beets/tree/feature/skip-bpm-fingerprint-error-diff which skip changes based on that condition. also not mention in this discussion, does bpm have some rounded function? i still have this change on 石田燿子 - Sailor Moon S Sdtk. - 愛の戦士
bpm: 145 -> 144.997955322
See-Saw - - あんなに一緒だったのに
bpm: 123 -> 122.99520874
時東ぁみ - Single - せんちめんたる じぇねれ〜しょん
bpm: 142 -> 141.999679565 |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I actually have this same issue when I get BPMs from the AcousticBrainz Plugin on beets version 1.4.9 running Python version 3.9.1 |
Problem
Generalized issue for the problem reported in #2929.
beets
has problems comparing certain fields like BPM for the commandswrite
andupdate
.So far it seems that the comparison problems are with at least three fields:
bpm: 96 -> 96.0649795532
)Setup
The text was updated successfully, but these errors were encountered: