Ap15e;657273 Wrote: 
> How do you manage to retrieve the original file even if it's moved or
> its tags have changed? Do you add unique 'SMD identifiers' to the
> metadata of the PlayableElements?
> Or to put it into other words: what is the link between a
> PlayableElement and the corresponding metadata stored in the SMD
> database?
> 
During import to SMD we calculate a checksum of the audio portion of
each imported file, in next import we re-calculate the checksum and
match it with the previously imported files. The checksum for FLAC
files based on the whole uncompressed audio portion (since FLAC has a
built-in checksum already) and for other file formats it's based on
10000 bytes in the middle of the compressed audio portion of the file.
The metadata portion of the file is not part of this checksum so it
doesn't matter if it's changed, the checksum will still be the same. If
you re-encode the file, for example change it from 256kbps -> 128kbps,
the checksum will change and we can't re-connect it, at least not if
you have simultaneously changed the file name/path and tags. Since
there is a theoretical chance that 10000 bytes won't be unique enough
in a large library, we append the length of the compressed audio
portion to make it unique.

One scenario we can't handle is if you have the exact same physical
file in two places in your library, this is currently not handled
properly but in this case we have to rely on the file name/path or tags
if two such files has been renamed/moved simultaneously as their
checksum is exactly the same. One example of this is that some people
creates their own compilation albums by copying files from their normal
albums, this would mean that the same file exist both in the normal
album and the compilation album.


-- 
erland

Erland Isaksson ('My homepage' (http://erland.isaksson.info))
(Developer of 'many plugins/applets'
(http://wiki.slimdevices.com/index.php/User:Erland). If my answer
helped you and you like to encourage future presence on this forum
and/or third party plugin/applet development, 'donations are always
appreciated' (http://erland.isaksson.info/donate))
Interested in music discovery ? See 'Social Music Discovery (SMD)'
(http://forums.slimdevices.com/showthread.php?p=656713) project.
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=90278

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to