LinuxMCE Forums

General => Users => Topic started by: colinjones on October 15, 2008, 06:23:37 am

Title: Re-initialising/clearing the media database...
Post by: colinjones on October 15, 2008, 06:23:37 am
Can anyone suggest a simple and safe way to completely clear the media database (pluto_media) that won't screw up the keys/indices/etc so that I can rescan in my entire media share without having to rebuild? There are a number of messed up attributes and coverart, so I want to start from scratch and check what it scans in from the id3s...
Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on October 15, 2008, 06:32:21 am
be sure to go to launch manager, and shut down core and media station.

then from a console:

Code: [Select]

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -r media import


That will re-flash your media database with a fresh copy from the release.

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: colinjones on October 15, 2008, 09:28:21 am
Cool! And that's perfectly safe?

Also, playlists are in a separate db aren't they?
Title: Re: Re-initialising/clearing the media database...
Post by: Marie.O on October 15, 2008, 09:46:06 am
Playlists are in pluto_media as well  :'(
Title: Re: Re-initialising/clearing the media database...
Post by: colinjones on October 15, 2008, 03:37:31 pm
Shit - gonna have to look at jon's backup utility afterall.... I wonder if that expects the keys to remain the same or just records the full path/filename? I would assume the latter as there is no guarantee of the keys...
Title: Re: Re-initialising/clearing the media database...
Post by: Marie.O on October 15, 2008, 09:13:42 pm
The playlist it self stores the keys only.
Title: Re: Re-initialising/clearing the media database...
Post by: colinjones on October 15, 2008, 11:26:33 pm
Doesn't that mean that if you clear the database that all the keys could potentially be different when it is refilled? Perhaps I should contact Jon on this as he would have had to think this through anyway (maybe he converts to paths on the export...)
Title: Re: Re-initialising/clearing the media database...
Post by: bundie on November 21, 2008, 01:37:53 am
be sure to go to launch manager, and shut down core and media station.

then from a console:

Code: [Select]

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -r media import


That will re-flash your media database with a fresh copy from the release.

-Thom


Hi guys,

Tried this last night, but borked my pluto_media database. After some hours of dispair found out i had to add "-D pluto_media" to the sqlCVS command, so in my case the last line should read:

Code: [Select]
/usr/pluto/bin/sqlCVS -D pluto_media -r media import

And system is back to normal now, with a clean pluto_media database...

Reint.

Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on November 21, 2008, 01:45:04 am
oo sorry, yeah.. um... apologies... :)

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: bundie on November 21, 2008, 01:54:29 am
No probs,

It reminded me again of the importance of backups... and not fooling around with a perfect working system too much!  ;)

Greets,
Reint.
Title: Re: Re-initialising/clearing the media database...
Post by: alx9r on November 21, 2008, 05:13:40 pm
I too am contemplating doing this.  I have a question about video files that use the .id3 sidecar files:

Does anyone know if _all_ attributes for video files are indeed stored in the .id3 files? 

I was poking around one of my .id3 files with taglib and found title, an image, and some other attributes, but couldn't find the "Media Sub-type" and "File Format" fields. 

Alex
Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on November 21, 2008, 05:14:58 pm
Those two fields you speak of are stored outside the attributes database, and are therefore currently not handled by UpdateMedia. We need to extend this.

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: alx9r on November 21, 2008, 05:19:42 pm
Those two fields you speak of are stored outside the attributes database, and are therefore currently not handled by UpdateMedia. We need to extend this.

Thanks.  Good to know.
Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on November 21, 2008, 05:21:10 pm
Actually, verifying this.. sorry.. I went back through UpdateMedia again, and it is indeed stored, but as a miscellaneous attribute.

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: alx9r on November 21, 2008, 05:23:20 pm
Actually, verifying this.. sorry.. I went back through UpdateMedia again, and it is indeed stored, but as a miscellaneous attribute.

Do you mean as a miscellaneous attribute in the .id3 file?
Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on November 21, 2008, 05:26:10 pm
Yes. I will post some details on it later. Point being, it's persisted.

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: davegravy on September 03, 2009, 10:31:47 pm
be sure to go to launch manager, and shut down core and media station.

then from a console:

Code: [Select]

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -r media import


That will re-flash your media database with a fresh copy from the release.

-Thom


Does this work in 810? How do you stop the Core and MD in 810?
Title: Re: Re-initialising/clearing the media database...
Post by: speeder13 on September 12, 2009, 07:23:59 am
I accidentally sync the whole "home" into my media database..Now it has bunch of weird videos (including those wizard video) in my media under "title". How can i remove them without messing up my system?  :(

I saw some solutions in this thread.. Will it be safe if i use the ways? Because it included everything in the "home" i am afraid i might break the whole system if i do any deletion.

Thx in advance....
Title: Re: Re-initialising/clearing the media database...
Post by: tschak909 on September 12, 2009, 07:33:12 am
lesson learned, don't fuck with things manually. this is what you get.

you'll need to drop the database and recreate it.

Seriously guys, all of you cause so many ^(@#^(@# problems because you tweak with stuff, you don't let the automatic stuff do its thing...

hmm.

-Thom
Title: Re: Re-initialising/clearing the media database...
Post by: Lexje on October 01, 2009, 10:58:59 pm
With respect;-
I  realize this question must have been raised more than a couple of times, but I can't seem to find a 'clean' answer.
Over time my media database has grown, and at several occasions I found to have double or triple items in it.
I come to realize now that this is most probably due to e.g. having
Code: [Select]
/moviedir
/moviedir/moviesubdir
/moviedir/moviesubdir/movie.iso
or whatnot as being present 3 time in this example in the media database.

I also realize there's a button "delete file" in Pluto Admin > Files & Media > Edit Media file but this will remove the file BOTH from database AND disk.
I'm looking for a way to remove ONLY from database?

Thanks for any pointer,

Erwin
Title: Re: Re-initialising/clearing the media database...
Post by: colinjones on October 02, 2009, 01:16:21 pm
I'm not sure what you mean.... a folder or subfolder will not appear as a media file unless you do something to make it happen manually.

I have many hundreds of folders, none of which appear as media files except in Filename sort mode in which case they are appearing as folders with files underneath them, exactly as they are supposed to do (if they didn't it would render Filename sort mode pointless)

When sorted by an attribute such as album, if you manually assign an Album attribute to a folder (rather than a file) then yes, they will appear... but that is OK too, because that is exactly what you just told it to do! If you don't want these folders to appear in those sort modes, don't assign attributes to them... there is no other reason to do so.
Title: Re: Re-initialising/clearing the media database...
Post by: Lexje on October 02, 2009, 02:27:12 pm
Hi Colin, thanks for replying;

I guess it's well possible that in the course of time, and certainly with a lack of knowledge and comprehension (this greatly improved viewing Thom's screencast on using media) that I erroneously created this situation.
I'm not stating this is an error of LMCE whatsoever.
Only problem is say I have 'a' particular movie, let's call it "Desperate Housewives", that appears say 3 times, and only plays when choosing the correct one (normally bottommost in filestructure order).

I have this situation more than once, and I would like to resolve this situation.
In a best case scenario, any media displayed should either be playable or invisible.

In my case, see screenshot, Disc 3 appears two times, when choosing item 2 on the search list (search on title), the video won't play..

So how can I remedy this situation (manually) if need be?

Thanks for helping out!

Erwin
Title: Re: Re-initialising/clearing the media database...
Post by: davegravy on October 02, 2009, 04:48:26 pm
Look to see if disc three has 2 title attributes, and if it does, delete the one you don't want.
Title: Re: Re-initialising/clearing the media database...
Post by: Lexje on October 02, 2009, 07:24:57 pm
Hi Dave,

Thanks for jumping in;
There are no 2 'Title' attributes... I do remember to have edited the title to reflect the disc number (as it is a 5 disc collection) otherwise there's no way to distinguish between disc 1 / disc 5...

When I do Pluto Admin > Files & Media > Media Browser
check title checkbox and enter desperate housewives I get the same 3 "titles", clicking on detail shows one empty...
Title: Re: Re-initialising/clearing the media database...
Post by: colinjones on October 03, 2009, 12:32:24 am
Oh you are talking about when you use the search function. Not when you are using the normal media browser.

Yes, that does happen, your experience is normal... if a little irritating! The search finds all entries in the database that match the search criteria which naturally includes the parent folders not just the file. Indeed, try doing the analogous search on a Windows machine.... you will find it does exactly the same thing.... it will find the media file Desparate Housewives as well as its parent folder Desparate Housewives because both match the search criteria.

The confusing and annoying thing in LMCE is that 1) it isn't obvious which is a file and which a folder, and 2) if you select a folder, LMCE will attempt to "play" it rather than enter it and display its contents
Title: Re: Re-initialising/clearing the media database...
Post by: Viking on December 16, 2009, 11:13:23 am
be sure to go to launch manager, and shut down core and media station.

then from a console:

Code: [Select]

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -D pluto_media -r media import

That will re-flash your media database with a fresh copy from the release.

-Thom


Does this work in 810? How do you stop the Core and MD in 810?

This question for 0810 was never answered ...

Do I start the core in single user mode and then do it ?
How can one do it in 0810 ?

Greetings
Viking
Title: Re: Re-initialising/clearing the media database...
Post by: the anxious on June 12, 2010, 04:18:37 pm
thanks to tschak909

Code: [Select]
/usr/pluto/bin/UpdateMediaDaemonControl.sh –disable

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -D pluto_media -r media import

/usr/pluto/bin/UpdateMediaDaemonControl.sh –enable
Title: Re: Re-initialising/clearing the media database...
Post by: bulek on September 29, 2011, 08:25:59 am
be sure to go to launch manager, and shut down core and media station.

then from a console:

...

That will re-flash your media database with a fresh copy from the release.

-Thom


How can I go to Launch Manager ? I only see launch manager when something is wrong or crashes...

Thanks,

Regards,

Bulek.
Title: Re: Re-initialising/clearing the media database...
Post by: twodogs on September 29, 2011, 06:03:20 pm
I just performed the procedure in post 26 and it worked great. No need to go to the launch manager, the first line of code stops the media daemon. I just went to KDE desktop and brought up a terminal. The only minor problem is that the "-disable" and "-enable" commands need to have short dashes, not long dashes. The following should work if you want to copy/paste into the terminal.

Code: [Select]
/usr/pluto/bin/UpdateMediaDaemonControl.sh -disable

mysql -uroot

drop database pluto_media;
quit

cp /usr/pluto/database/media.sqlcvs .

/usr/pluto/bin/sqlCVS -D pluto_media -r media import

/usr/pluto/bin/UpdateMediaDaemonControl.sh -enable
Title: Re: Re-initialising/clearing the media database...
Post by: bulek on October 02, 2011, 11:27:18 pm
Hi,

I have followed procedure on 7.10 and got only partial success. I've managed to shutdown core services, dropped database, imported fresh one. Enabled daemon, but the problem is that after 3 days, if I press Filename option in Video or Audio menus I get empty screen - seems like no media file is present...

Through web-admin I can find files that have Location filled - for instance "/home/public/data/videos/Media [41]/Funny/name_movie.mp4" but they don't appear on Orbiters...

What is wrong - maybe I'm missing something obvious ?

Thanks in advance,

regards,

Bulek.