Author Topic: Re-initialising/clearing the media database...  (Read 19657 times)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re-initialising/clearing the media database...
« 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...

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #1 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

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #2 on: October 15, 2008, 09:28:21 am »
Cool! And that's perfectly safe?

Also, playlists are in a separate db aren't they?

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Re-initialising/clearing the media database...
« Reply #3 on: October 15, 2008, 09:46:06 am »
Playlists are in pluto_media as well  :'(

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #4 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...

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Re-initialising/clearing the media database...
« Reply #5 on: October 15, 2008, 09:13:42 pm »
The playlist it self stores the keys only.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #6 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...)

bundie

  • Veteran
  • ***
  • Posts: 55
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #7 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.


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #8 on: November 21, 2008, 01:45:04 am »
oo sorry, yeah.. um... apologies... :)

-Thom

bundie

  • Veteran
  • ***
  • Posts: 55
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #9 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.

alx9r

  • Guru
  • ****
  • Posts: 187
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #10 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

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #11 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

alx9r

  • Guru
  • ****
  • Posts: 187
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #12 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.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #13 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

alx9r

  • Guru
  • ****
  • Posts: 187
    • View Profile
Re: Re-initialising/clearing the media database...
« Reply #14 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?