Author Topic: Annoucement: Getting cover art and attributes from IMDB  (Read 36730 times)

chriss

  • Veteran
  • ***
  • Posts: 140
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #15 on: December 14, 2008, 06:10:20 pm »
Ok, I submitted the patch to Trac [1]. If you want to try it, you should also consider patching a small bug [2] (which appears on Amazon scans, too). It is working without any problems on my systems, however, use it at your own risk ;)

I'll appreciate any kind of feedback and suggestion.

Bye,
/chriss


[1] http://svn.linuxmce.org/trac.cgi/ticket/53
[2] http://svn.linuxmce.org/trac.cgi/ticket/52

chriss

  • Veteran
  • ***
  • Posts: 140
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #16 on: December 14, 2008, 10:06:00 pm »
Zaerc,

thanks for applying my patches!

/chriss

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #17 on: December 14, 2008, 10:45:41 pm »
No, thank you for your contributions.  Keep it up and you'll get your own SVN access after the worst dust has settled...

ANyway, I was just about to say that I've added them to the 0810 branch, but I guess you already noticed.  There will probably be another update tonight so it should be available to the alpha1 users tomorrow
"Change is inevitable. Progress is optional."
-- Anonymous


nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #18 on: December 17, 2008, 11:56:05 am »
Additionally we can create a simple Perl script, which will use IMDB::Film to try to retrieve a movie info by its file name in background. The module works fine and as I know many people use it.
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #19 on: January 25, 2009, 12:15:27 am »
Thanks for a great addition :)

I did have problems patching it...
I had to manually edit the following files:
coverArt.lang.php
editMediaFile.lang.php
editMediaFile.php

Would the .rej files help?

I also found 2 bugs, the first is just a a text that is not translated.
The option to include attributes is called "Include Amazon attributes" and should be IMDB.
The other is Genres. If a Genre does not exist, it gets added as a Title or a Album.
For example I have never used the Genre "Drama", all movies get a second Title called "Drama".
After adding the Genre "Drama" manually to one movie, it gets added correctly as a Genre.

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #20 on: January 25, 2009, 08:44:44 am »
I am now tagging my movies with IMDB attributes. I must say I love the extra info.

But not all is well... I have now come across 2 movies that produce a error.
I find the movie, but when I press "Get coverart" I get an error.

Step Brothers:
Code: [Select]
Fatal error: mysql error: [1062: Duplicate entry '25678-2131-0-0' for key 1] in EXECUTE("INSERT INTO File_Attribute (FK_File,FK_Attribute) VALUES ('25678','2131')") in /var/www/pluto-admin/include/adodb/adodb-errorhandler.inc.php on line 77
Transporter 2:
Code: [Select]
Fatal error: mysql error: [1062: Duplicate entry '26512-871-0-0' for key 1] in EXECUTE("INSERT INTO File_Attribute (FK_File,FK_Attribute) VALUES ('26512','871')") in /var/www/pluto-admin/include/adodb/adodb-errorhandler.inc.php on line 77
One other thing. It's slow (and worth it). Sometimes the search is fast, and whenever I see a difference in the speed the list is shorter. When It's slow, I get a duplicate list of selectable movies. When It's fast I get only the movie I'm after.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #21 on: January 25, 2009, 09:40:47 am »
The speed has to do with the datagrid fetch.

As for the error you're getting, you'd only get that if you were manually fucking with the File table. (No, don't say otherwise, you were messing with the database manually. DON'T DO THAT!)

-Thom

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #22 on: January 25, 2009, 08:59:00 pm »
Hehe... How do I fuck with the file table?!?

I'm sorry to say that I have not done anything to the database. But what I have done, is install my DVB-C card in the Core again hoping that it would be stable now... The problem is that every time I do that, the server starts hardlocking. Usually every 6-8 hours. Black screen, no response to keyboard/mouse, network is down, ssh not responding, no internet on other PC and the power button does not shutdown the server. I have to hold the power button til it shuts down.

The server did hardlock on me while I was tagging media, just after pressing the "Get Coverart" button and I had to power down and boot. That could explain the file table with errors.

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #23 on: January 25, 2009, 10:19:08 pm »
Just did a Clean 0710RC2 reinstall. Wiped the drive....
I patched with no media on the server.
As you can see, I get the same errors.

Code: [Select]
linuxmce@dcerouter:/var/www/pluto-admin$ sudo patch -p0 < imdb_cover_art.patch
(Stripping trailing CRs from patch.)
patching file coverArtExtractor_IMDB.php
(Stripping trailing CRs from patch.)
patching file include/imdb/browseremulator.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb_base.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb_config.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb_person.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb_person.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdb_request.class.php
(Stripping trailing CRs from patch.)
patching file include/imdb/imdbsearch.php
(Stripping trailing CRs from patch.)
patching file index.php
(Stripping trailing CRs from patch.)
patching file languages/en/coverArt.lang.php
Hunk #1 FAILED at 21.
1 out of 1 hunk FAILED -- saving rejects to file languages/en/coverArt.lang.php.                                                                                                                     rej
(Stripping trailing CRs from patch.)
patching file languages/en/editMediaFile.lang.php
Hunk #1 FAILED at 24.
1 out of 1 hunk FAILED -- saving rejects to file languages/en/editMediaFile.lang                                                                                                                     .php.rej
(Stripping trailing CRs from patch.)
patching file operations/mediaBrowser/checkIMDB.php
(Stripping trailing CRs from patch.)
patching file operations/mediaBrowser/editMediaFile.php
Hunk #1 FAILED at 97.
1 out of 1 hunk FAILED -- saving rejects to file operations/mediaBrowser/editMed                                                                                                                     iaFile.php.rej
linuxmce@dcerouter:/var/www/pluto-admin$

The .rej files is posted below:
coverArt.lang.php.rej
Code: [Select]
***************
*** 21,27 ****
  $TEXT_MATCHCOVERART_CONST='Match Cover Art';
  $TEXT_COVER_ARTS_UPDATED_CONST='Cover arts updated';
  $TEXT_GET_AMAZON_ATTRIBUTES_CONST='Get Amazon attributes & cover art';
  $TEXT_AMAZON_KEYWORD_CONST='Amazon keyword';
  $TEXT_FILENAME_CONST='Filename';
  $TEXT_WARNING_AUTOMATIC_GRAB_ACTIVE_CONST='Automatic script who retrieve coverarts from Amazon is working. You can stop it at any time or let it finish then match the results.';
  $TEXT_SEARCH_FOR_PATH_CONST='Search for path';
--- 21,29 ----
  $TEXT_MATCHCOVERART_CONST='Match Cover Art';
  $TEXT_COVER_ARTS_UPDATED_CONST='Cover arts updated';
  $TEXT_GET_AMAZON_ATTRIBUTES_CONST='Get Amazon attributes & cover art';
+ $TEXT_GET_IMDB_ATTRIBUTES_CONST='Get IMDB attributes & cover art';
  $TEXT_AMAZON_KEYWORD_CONST='Amazon keyword';
+ $TEXT_IMDB_KEYWORD_CONST='IMDB keyword';
  $TEXT_FILENAME_CONST='Filename';
  $TEXT_WARNING_AUTOMATIC_GRAB_ACTIVE_CONST='Automatic script who retrieve coverarts from Amazon is working. You can stop it at any time or let it finish then match the results.';
  $TEXT_SEARCH_FOR_PATH_CONST='Search for path';

editMediaFile.lang.php.rej
Code: [Select]
***************
*** 24,29 ****
  $TEXT_DATE_ADDED_CONST='Date added';
  $TEXT_CONFIRM_DELETE_PICTURE_CONST='Are you sure you want to delete this picture?';
  $TEXT_GET_INFO_ON_AMAZON_CONST='Get Amazon attributes';
  $TEXT_SEARCH_PHRASE_CONST='Search phrase';
  $TEXT_SEARCH_OPTIONS_CONST='Search options';
  $TEXT_SEARCH_AMAZON_CONST='Search AMAZON';
--- 24,30 ----
  $TEXT_DATE_ADDED_CONST='Date added';
  $TEXT_CONFIRM_DELETE_PICTURE_CONST='Are you sure you want to delete this picture?';
  $TEXT_GET_INFO_ON_AMAZON_CONST='Get Amazon attributes';
+ $TEXT_GET_INFO_ON_IMDB_CONST='Get IMDB attributes';
  $TEXT_SEARCH_PHRASE_CONST='Search phrase';
  $TEXT_SEARCH_OPTIONS_CONST='Search options';
  $TEXT_SEARCH_AMAZON_CONST='Search AMAZON';

editMediaFile.php.rej
Code: [Select]
***************
*** 97,102 ****
  $externalAttributesBtn='';
  if(in_array($rowFile['EK_MediaType'],array(3,4,5))){
  $externalAttributesBtn='<input type="button" class="button_fixed" value="Check Amazon" onClick="self.location=\'index.php?section=checkAmazon&fileID='.$fileID.'\'">';
  }
 
  $mediaSubTypes=getAssocArray('MediaSubType','PK_MediaSubType','Description',$mediadbADO,'ORDER BY Description ASC');
--- 97,103 ----
  $externalAttributesBtn='';
  if(in_array($rowFile['EK_MediaType'],array(3,4,5))){
  $externalAttributesBtn='<input type="button" class="button_fixed" value="Check Amazon" onClick="self.location=\'index.php?section=checkAmazon&fileID='.$fileID.'\'">';
+ $externalAttributesBtn .='<input type="button" class="button_fixed" value="Check IMDB" onClick="self.location=\'index.php?section=checkIMDB&fileID='.$fileID.'\'">';
  }
 
  $mediaSubTypes=getAssocArray('MediaSubType','PK_MediaSubType','Description',$mediadbADO,'ORDER BY Description ASC');

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #24 on: January 25, 2009, 10:39:16 pm »
After manually patching the remaining files, Genres does get made correctly.

But I did get this error on the second media I tried adding after pressing the "Get Coverart" button:
Code: [Select]
Fatal error: mysql error: [1062: Duplicate entry '168-78-0-0' for key 1] in EXECUTE("INSERT INTO File_Attribute (FK_File,FK_Attribute) VALUES ('168','78')") in /var/www/pluto-admin/include/adodb/adodb-errorhandler.inc.php on line 77
The strange thing is, if I enter the same media again, now it has coverart and all the attributes.

chriss

  • Veteran
  • ***
  • Posts: 140
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #25 on: January 26, 2009, 07:14:55 am »
cirion,

But I did get this error on the second media I tried adding after pressing the "Get Coverart" button:
Code: [Select]
Fatal error: mysql error: [1062: Duplicate entry '168-78-0-0' for key 1] in EXECUTE("INSERT INTO File_Attribute (FK_File,FK_Attribute) VALUES ('168','78')") in /var/www/pluto-admin/include/adodb/adodb-errorhandler.inc.php on line 77
The strange thing is, if I enter the same media again, now it has coverart and all the attributes.

I've seen this error happen to my system several times... no only with the IMDB patch but also with the older amazon attribute fetching. I haven't looked into this yet, but if you just do a reload the error does not occur again and the data is stored as expected.

I did have problems patching it...
I had to manually edit the following files:
coverArt.lang.php
editMediaFile.lang.php
editMediaFile.php

Hmm, would have to check the patch again. If I remember correctly, there was a problem when adding the stuff to SVN, too, but the problem was fixed. I think it was my fault because I somehow mixed up different branches (0710, 0810 and trunk).

I also found 2 bugs, the first is just a a text that is not translated.
The option to include attributes is called "Include Amazon attributes" and should be IMDB.

Ok, this is a simple one. I attached it to the original ticket and will fix it. (#53)

The other is Genres. If a Genre does not exist, it gets added as a Title or a Album.
For example I have never used the Genre "Drama", all movies get a second Title called "Drama".
After adding the Genre "Drama" manually to one movie, it gets added correctly as a Genre.

I think this is not related to the IMDB patch which only fetches the attributes. Under some circumstances you should see that behavior with amazon, too. Please try to apply the patch from ticket #52 (http://svn.linuxmce.org/trac.cgi/ticket/52) and report back if the problem stays.

One other thing. It's slow (and worth it). Sometimes the search is fast, and whenever I see a difference in the speed the list is shorter. When It's slow, I get a duplicate list of selectable movies. When It's fast I get only the movie I'm after.

Yeah, I know that it is slow. Unfortunately you have to do several queries to IMDB to fetch all the information and the more movies you find with the search, the slower it gets...

Anyway, thanks for the feedback!

br,
/chriss

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #26 on: January 28, 2009, 10:18:11 pm »
Is it possible to download IMDB patch as one file? It's too annoying to copy and paste many times :)
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #27 on: January 28, 2009, 11:15:38 pm »

chriss

  • Veteran
  • ***
  • Posts: 140
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #28 on: January 29, 2009, 05:56:11 am »
I used the link at the bottom of the page...
http://svn.linuxmce.org/trac.cgi/attachment/ticket/53/imdb_cover_art.patch?format=raw

The line numbers of the patches will be different to 0710 because there are several modifications already done for web admin in 0810. However, usually this should work without problems.

cirion,
did you apply the patch from ticket #52? Does it help your problem?

br,
/chriss

Bozza

  • Making baby steps
  • Posts: 3
    • View Profile
Re: Annoucement: Getting cover art and attributes from IMDB
« Reply #29 on: August 25, 2009, 02:15:56 pm »
Attempted to use this script as amazon is no longer an option, after what I believe was a successful patch each attempt simply shows "no results"

Any clues what im doing wrong? or is this simply not compatiable with 710 anymore?

Any guideance is appreciated :)