MySQL: differentiate local vs shared media

the MySQL setup assumes that all media in the DB is accessible by all devices. this requires all devices to share their media.
in the scenario where a device contains local media that is not shared, the media is scanned and added to the DB. this can cause an issue from other devices, for example: during randomized play or cleaning the library.

my suggestion is to add a column in the DB that would contain either public or device specific ID (name, serial, hash, etc). this would prevent another device from either attempting to access the media or remove the items from the library. in addition, duplicate situations could be handled.

example:
NAS contains: a,b,c,d
DEVA contains: a,b,e,f
DEVB contains: g,h

both DEVA & DEVB have access to shared media on the NAS.
media list in the DB would look like: a,b,c,d,e,f,g,h.

however:

  • DEVB would fail to access e,f.
  • DEVA would fail to access g,h.
  • cleaning the library on DEVB would remove e,f.
  • cleaning the library on DEVA would remove g,h.
  • DEVA would see a,b twice.

i imagine a flag could be set as either public or local media – where the media in library is tagged with device specific ID.

what do you think?