Author Topic: how to create a Unique ID  (Read 348 times)

sebmuc

  • Newbie
  • *
  • Posts: 3
Hi all, does anyone have an idea how to create a unique ID for each library entry? would be nice to use the MusicBee one (i guess there is one) but i can't access it from the variables.

Thanks a lot for your help.

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2463
What do you mean by "unique ID"?
The only thing unique to each track in your library would be its file path, which you can access for other purposes.

People may be able to provide better solutions if you explain the scenario you actually want to use this ID for.
There are probably other ways to achieve it.
Bee excellent to each other...

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1282
I believe the Additional Tagging & Tools plugin can create or stores unique track IDs, but I'm not too familiar with the process and how it works.

hiccup

  • Sr. Member
  • ****
  • Posts: 7902
The first possible way of achieving this that comes to my mind is by using hash codes.
Then for each and every file in your library a hash code could be calculated and stored in the database. (not in the file ;-)

But considering that most users will be modifying their music files once in a while, that will be quite problematic to maintain.

Perhaps you could use some existing tag such as 'date added'?
If you specify that time/date field into milliseconds (that can be done, can't it?) I am guessing you will have unique values for each file.
(assuming you are not using some quantum computer)

You could also create a custom tag for this specific purpose that you could write by e.g. using an AT&RT command such as $Now.
Not sure if/how that would work, it's just an idea that comes up.

Or a solution could be to use MusicBrainz' Picard and use the musicbrainz_recordingid tag.
But that will only work for songs that are in their database.
Last Edit: January 02, 2024, 04:22:16 PM by hiccup


Przemek

  • Newbie
  • *
  • Posts: 16
Do you mean an ID for each entry that will be used within MB? Maybe you can just create a custom field? I have an ID field that I use for releases, you can do it manually or make a virtual field where it can be more nuanced (include the publisher, release type, etc.)

boroda

  • Sr. Member
  • ****
  • Posts: 4642
MB already stores permanent track unique id for every track. this id won't be changed if track path is changed. it's also preserved if you use MB's 'replace source file' feature (e.g. to replace track by higher quality one). tag tools plugin uses these ids for backup & restore functionality.

but i don't think there is a user-friendly way to access these ids.