Author Topic: How do we update DVD cover art that amazon can't get?  (Read 8733 times)

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
How do we update DVD cover art that amazon can't get?
« on: May 30, 2008, 09:02:17 am »
Some of my DVDs can't get the correct cover art from amazon, usually its a foreign version or an HD-DVD, etc.  How can I update these manually?  I am not having much luck with the media file sync add/update pic feature.  It works for the pic after you click on the movie, but not the one you see in the orbiter when you are browsing.  I have tried to overwrite the pic in /home/mediapics with what I want to use but then it generates another file and thumbnail with a higher number and uses the original pic I chose.  Has anyone gotten this to work?  I'm using a jpg, and I've restarted the router and orbiter after updating and I still am not having any luck.  Also I notice after I enter a pic to use, it creates the thumbnail and regular file, but when I browse the /home/mediapics dir using the preview function in KDE I can see the thumbnail pic ok, but the regular one is not visible.  When I click on it the pic browser comes up but nothing is visible, like it is corrupted or something.  Any help will be appreciated.

wombiroller

  • Guru
  • ****
  • Posts: 340
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #1 on: May 30, 2008, 01:42:56 pm »
Are you regenerating the orbiter(s) after updating the cover art? If not - that should be all you need to do.

Wizards -> Devices -> Orbiters  (regen button) via web admin or in advanced via the UI....
« Last Edit: May 30, 2008, 01:44:54 pm by wombiroller »

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #2 on: May 30, 2008, 11:43:26 pm »
Are you regenerating the orbiter(s) after updating the cover art? If not - that should be all you need to do.

Wizards -> Devices -> Orbiters  (regen button) via web admin or in advanced via the UI....

I just added a new pic, about the same size as the amazon ones, and in jpg format.  I see it in the database when I click on the movie.  Then I regenerated the orbiter and don't see it.  I tried to resync the database, then regenerate the orbiter, no luck.  I also reloaded the router, still don't see the pic in the orbiter or after selecting the movie and displays the larger pic and the attributes.  Anyone have any ideas why this is not working?


royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #3 on: May 31, 2008, 09:39:01 am »
I think the db relationships for the pictures are as follows:

* Each media file has an entry in pluto_media.File. 
* Each entry has a primary key (identifier), PK_File.
* Each picture has an entry in pluto_media.Picture.
* Each picture has a primary key, PK_Picture.
* Each media file and picture are joined with the pluto_media.Picture_File table.  This table consists mainly of two foreign key columns, FK_File and FK_Picture (foreign keys contain the values of primary keys in their respective tables). 
* Each media picture resides in /home/mediapics directory.
* Each media picture consists of two images, the "full" and a "thumbnail".
* "full" images are named: {PK_Picture}.jpg  (example for PK_Picture of 123, the file would be /home/mediapics/123.jpg)
* "thumbnail" images are named {PK_Picture}_tn.jpg (example for PK_Picture of 123, the file would be /home/mediapics/123_tn.jpg)
* I have not found the image size constraints on the "full" image, sorry.
* The "thumbnail" image size is 256x256.
* It is the "thumbnail" image that is displayed in the orbiter.

OK, background out of the way.  :)

Now what you can do is look up the File record, get the PK_File value.  Then look up the PK_Picture id in the Picture_File table.  Now with the PK_Picture id, you can check to see if the jpg images (both "full" and "thumbnail") exist in the /home/mediapics directory.

Here's an example where I look up "The Fifth Element" dvd on my system:
Code: [Select]
linuxmce@dcerouter:~$ mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14214
Server version: 5.0.45-Debian_1ubuntu3 Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use pluto_media;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select PK_File from File where Filename='The Fifth Element.dvd';
+---------+
| PK_File |
+---------+
|     983 |
+---------+
1 row in set (0.00 sec)
mysql> select FK_Picture from Picture_File where FK_File=983;
+------------+
| FK_Picture |
+------------+
|        530 |
+------------+
1 row in set (0.01 sec)

mysql> quit
Bye
linuxmce@dcerouter:~$ ls -l /home/mediapics/530*
-rw-r--r-- 1 root root 70874 2008-05-30 03:23 /home/mediapics/530.jpg
-rw-r--r-- 1 root root 11887 2008-05-30 03:23 /home/mediapics/530_tn.jpg

If the files exist, you can verify their integrity by viewing them with firefox or whatever your favorite image viewer is.

HTH,
Roy


jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #4 on: May 31, 2008, 11:51:41 pm »
Roy, thank you very much for the detailed info on how these are stored in the database.  I see that as soon as I add a pic to the admin control webpage, the corresponding ###.jpg and ###-tn.jpg and created in /home/mediapics.  I can view the thumbnail picture in the folder, but the ###.jpg does not seem valid.  I get no preview, and when I click on it I see no reported dimensions, and I can't view it when I open it in another program such as Gwenviewer or firefox.  The thumbnail works fine in preview, dimensions, and gwenviewer/firefox.

Even though the ###-tn.jpg pic is valid and I can view it, it does not show up in the orbiter.  I have restarted the orbiter, and linuxMCE from the control panel and I still see only the text title name where the DVD cover should be.

The dimensions of the photo I add are approximately the same as the full-size (500 px tall) screen covers from amazon, and it is a jpg format.  Any ideas?  I'm going to post one to this thread so maybe someone who has gotten this to work can see if my pic works on their system.  It could be a problem with the images, although the thumbnail gets created fine.


jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #5 on: June 01, 2008, 12:02:23 am »
Another thing I've tried is to add the "wrong" pic from amazon, then overwrite that file, but the database picks up on this and creates a new file ###+1.jpg and ###+1_tn.jpg.  Is there a way to overwrite these files it uses with valid ones and trick it to use the existing ones?  I tried this even after stopping linuxMCE and starting it after and it still picked up on the fact that the file had changed.  Does it keep track of the size or last modified information?  Is it possible to do this?  I don't mind it, it's a small percentage of the DVDs, less than 5%.

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #6 on: June 01, 2008, 12:29:55 am »
Here is the image I used in the above test, but I've tried other DVDs/images the same size and type.


royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #7 on: June 01, 2008, 08:01:14 am »
A couple of thoughts.  First delete the all pictures for the file using pluto_admin, Media Files Sync.  Then download a new one (without attributes) using Check Amazon.

Now on the Edit Media file page, if you mouse over the cover art, it will show you a path like:  http://192.168.80.1/pluto-admin/mediapics/xxx.jpg.  If you show the image properties, the actual image you are looking at is the thumbnail, ex, http://192.168.80.1/pluto-admin/mediapics/xxx_tn.jpg.

Now when these are correct, it should be showing up in the orbiter.  If not, try regen'ing all orbiters and reloading the router.  If that doesn't work, then try a reboot.

Here's a way to force updating the thumbnails, from a terminal, run:

  sudo /usr/pluto/bin/UpdateMedia -t -d PATH

where PATH is the directory where your dvd is.  Here's an example for mine: 

  sudo /usr/pluto/bin/UpdateMedia -t -d "/home/public/data/videos/NFS Share [39]/Action"

Note, you do have to shell escape (prepend with a backslash) these characters in the path:  \ $ " `

Worst comes to worst, you might try deleting the media file totally, then re-ripping it.  That will establish new primary key ids just in case something was crossed.

I really hate even suggesting a reinstall, but sometimes it does help when things are out of whack.  So absolute worst case, if your media is on a different drive than your dcerouter (highly recommended), then from Media Files Sync, resynchronize on your top level video directory (this syncs the id3 files with the database), then do device config backup (Advanced, Configuration, Backups), then reinstall LMCE and have the installer create a new db.  UpdateMedia will rebuild the database from the id3 files (might take a while, like overnight).  You can restore your device configs from Advanced, Configuration, Backups. 

HTH,
Roy

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #8 on: June 01, 2008, 09:23:39 pm »
Thanks Roy.  Just to clarify, anything I download from amazon works great.  The problem is when I can't find something to match up, I want to add my own cover art.  This seems to be supported since it lets me add a pic in the edit media page.

For the movie above, Spies Like Us, I can see the pic and thumbnail just as you describe.  When I click on the link it works fine, it opens the full pic ###.jpg in a new tab and I can view it.  I did reload the orbiters, router, and system and it still does not show up. 

A reinstall is out of the question at this point, this is a brand new install.  All I have done so far is copy 100 or so DVDs to my public media directories and update cover art.  If this wasn't built on a raid array I would have no problem doing the install over again.  I don't see why that would be required now since it is still a new installation. 

Like I said, the problem is adding my own covers, amazon imported ones are working fine. 

I asked above about adding a pic through amazon (which will work), and then overwriting the ###.jpg and ###-tn.jpg files with what I actually want to use.  Is there a way to get that to function as a workaround since the normal route is simply broken?  Is there any documentation on this as far as specs of the files to use, or any tricks?  It seems to be a simple process to add pics, yet it is not working.  That is a little work but I'm willing to do it to have the correct cover art, not some foreign version or HD, etc.

Thanks for all the help.

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #9 on: June 02, 2008, 04:14:05 am »
OK, gotcha. 

I took your Spies Like Us image, copied it to my core, then picked one of my movies, moved it's images from /home/mediapic to ~, then copied your image to my movie's id.jpg.  Then I ran the UpdateMedia -t.  Went to the orbiter and verified that the Spies Like Us image is shown.

Just copying images over the correct id.jpg, and deleting the thumbnail, then running the UpdateMedia -t ought to be all that is required (I've actually updated over 500 dvd images that way when I sync my collection from DvdProfiler - another thread).

Grasping at straws, how are you transferring the jpgs to your core?  Maybe make sure its a binary transfer.  Maybe try an alternative transfer method (scp, sftp, usb stick).  FYI, I use scp to transfer the images between my gentoo workstation and my core.

Verify ownership/permissions of id.jpg match the originals in the /home/mediapics directory.

When you run UpdateMedia -t, examine the output for errors, particularly for any references to your new image.

HTH,
Roy

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #10 on: June 02, 2008, 07:21:24 am »
Roy,

I was copying the image from a USB flash drive so it didn't get corrupted in the transfer. 

I am wondering the the problem is with this.  I tried what you said below.  I added a wrong pic from amazon.  Then I stopped MCE, deleted the thumbnail, and overwrote the ###.jpg file with the new image.  The permissions and owner were exactly as the original file.  When I run updateMedia -t it creates a new ###+1 with the old file and uses that in orbiter. 

Is there a way to just scratch the entire database without reloading MCE?  Like I said if it was the dvd install I would but I have to load Kubuntu on raid, then do the MCE cd install on top of that.  Plus I have 100s of gigs of data I'd have to move off and put back that is on the main system / partition.  I have a lot of wierd stuff going on with my database I think. 

Also what is the procedure to not get all raid data pulled into MCE?  I have a raid partition that is mounted as root which MCE is installed on.  THen I have another 2 disks with another raid partition.  These are visible in configuration/RAID but I don't really want them to be.  I manually created the symlink to a bunch of DVDs stored on the second partition.  There is some media on the system partition (not in /home/anything) and I don't want that being entered into the database, but it has been before when it was in a home directory (user jmc). 

I think I messed up by resyncing from the /home dir so that must be when it pulled everything in.  Like I said, I would like to just blow away the database.  I don't mind re-updating all my cover art, etc.  I hope there is a procedure for this.

Thanks again for all your help!

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #11 on: June 02, 2008, 08:10:46 am »
Just an update, I got it working where I overwrite the existing (wrong) cover with the new pic.  I just needed to do it without stopping MCE.  I corrected the permissions and ownership, deleted the thumbnail, and copied the correct pic to overwrite the incorrect one.  In a few seconds it auto-generated the thumbnail and its working. 

I still would not mind clearing the database if its possible.  Is it possible to load the DVD install on an existing RAID array?  Is there any way to clear out the database and start fresh with the current install?  That would really be ideal.  I have one movie (Bad Boys) that won't show up no matter what.  I see the file, and I see it in the database, but not in orbiter.  When I scan for media with no pic (this has no pic) I don't get this DVD to show up, however when I scan for all media, and search for "boys" it comes up, along with Bad Boys II.  For these and other wierd database issue reasons I'd like to delete the database and start fresh.  So far I have only about 100 dvds installed and none of my music collection.

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #12 on: June 02, 2008, 08:25:56 am »
Nevermind, at some point it went back and generated ###+1.jpg and thumbnails again.  This is not working for me at all.  What about the correct way to add a file in the media sync page.  That is not working either but I'd like to get one way or the other to work.

I'm still very interested in deleting the database if anyone has any pointers there..


royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #13 on: June 02, 2008, 11:49:14 am »
I'm not sure how to reinitialize the databases without a reinstall.  Anyone?

Because I've been exploring/hacking the database, I usually do a msqldump after a reinstall, so I have a database that I can try to reload. That actually does work most of the time, but not always (recently my attempt at removing unused Genres required a reinstall to recover).

The *+1.jpg files are confusing me a little.  Under Media Files Sync, do you see multiple images in the media file?  I don't have any in my /home/mediapics directory and I'm not seeing how editMediaFile.php could create one.  Also am not seeing it in the UpdateMedia source.

On your system setup, I understand where you are coming from. I initially built my core with a 500GB system drive, expecting to use it for some media.  After being a little stupid and installing a newer version, and incidentally wiping my first handful of ripped dvds, I concluded that the way to set up a core is to install it to it's own hard drive and keep all media on other drives.  This let's you easily upgrade or reinstall using the DVD installer.  Also I use two hard drives when trying a new LMCE version, one has my "stable" system, the other my "testing" system.  Because of case limitations, I physically swap drives.

FYI, my setup is core/hybrid with 74GB Raptor system drive and a 1TB media drive, plus two other systems each with 3 1TB media drives (one configured as a single LVM volume, the other as a RAID5 - hey I was experimenting) connected via NFS.  BTW, I don't recommend the Raptor, it's a little noisy, but it's what I had left over.

With this setup, the media (.dvd + .id3 files) are not on the core's system drive.  After reinstall, UpdateMedia rebuilds the database from the .id3 files.  The pain to me of reinstalling has been all the little tweaks, but I've recently automated that using Capistrano (another thread).

I can't really see any need to have the system drive on a RAID.  If you have a 20+GB drive laying around, you might want to add that as a system drive.  BTW, during a dvd install, you are asked which drive to install to.  Life is easier if your system drive is the first drive and/or the system drive is a unique model or size so you can readily identify it.

This is just food for thought.  I've found that my LMCE setup changes over time - hey it's a hobby!  :)

HTH,
Roy

jmcrtp

  • Regular Poster
  • **
  • Posts: 31
    • View Profile
Re: How do we update DVD cover art that amazon can't get?
« Reply #14 on: June 03, 2008, 07:10:11 am »
Thanks for the info Roy.  I think I will reload this on a 200GB drive that is non-raid so I can upgrade easier later and reinstall if needed.  Can you please post the steps to backup the database?  I'll do that prior to adding any media.

Also, I am going to have two other sets of disks mirrored, so I'll have /dev/md0 and /dev/md1.  How do I stop these from showing up in the database?  I only want a few folders I pick, and I will manually add the symlinks.  On my current install the raid partitions are discovered, then a symlink is added under /home/public/data/other, so all the content on both partitions was added to the database, which is probably which caused  all these issues in the first place.