Pedro Sigwald wrote:
i'm trying to find a way to manage the music from the
front end by addin an "Erase Music" button. the idea
is to get rid of the mp3 and ogg in a "physically"
way.
i'm debuggin the aplication to find out a way to erase
the music and update de db all-in-one-user-transparent
way but i'm havin some problems: it seems that music
is erased from the hdd but i have to run music manager
to see it in the tree. any sugestions?


How about executing an SQL command something along the lines of
"DELETE FROM musicmetadata WHERE intid=123;" when you delete your track?

Or a better method would be to add a method which erases the loaded metadata. I can't remember off hand where it is (may be part of the Metadata:: class) but there is a method called isInDatabase() (or soemthing like that). Perhaps a companion method called removeFromDatabase() would be a good idea? You can slap the SQL to remove from the database in there perhaps?

Also, can you make your method failsafe, such that if it cannot remove from disk, it does NOT remove from DB. I often have Myth boxes using readonly network filesystems, and it would be nice to not mess up the DB if the actual delete can't happen.

Cheers

Col.


--

+------------------------+
|     Colin Guthrie      |
+------------------------+
|   [EMAIL PROTECTED]  |
| http://colin.guthr.ie/ |
+------------------------+
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to