Opened 12 years ago

Closed 12 years ago

#3585 closed enhancement (fixed)

[PATCH] Add cast information to mythvideo

Reported by: anonymous Owned by: Anduin Withers
Priority: minor Milestone: 0.21
Component: mythvideo Version: head
Severity: medium Keywords: cast
Cc: Ticket locked: no

Description (last modified by Rob Smith)

Proposed patch to add cast (actors) information from IMDB to mythvideo. This patch does the following:

  1. Adds cast column to videometadata in database
  1. Adds "View Cast" button in menu that has "View Full Plot"
  1. Updates videomanager to get the cast information and put it in the database (note the script imdb.pl already gets the cast info)
  1. Adds cast textarea for themes. Existing themes are not impacted and do not need to be changed if "View Cast" button is enough for you. Use it if you want, otherwise the existing themes will look the same as before this patch. For me, I plan to change the "director" container to "cast" in my person theme.
  1. Update imdbpy.py to get the cast info
  1. Correct to MythTV.py to get the database IP address properly from mysql.txt
  1. White space correction to imdb.pl for cast info.

I also attached a new script get_cast.py which will add cast information for all the videos you already have in the database. This is handy for people like me that have more than 200 videos already in the database and have performed some custom editing of the imdb data.

If you wish to add cast information to your theme copy or replace the director textarea and change "director" to "cast"

Attachments (7)

mythvideo-cast.diff (22.2 KB) - added by maverik044 12 years ago.
get_cast.py (1.7 KB) - added by maverik044 12 years ago.
Script to fill cast info for existing videos. Need to have python and python-imdbpy installed. See imdbpw.py script for more info.
mythvideo-cast-new.diff (41.7 KB) - added by maverik044 <level42@…> 12 years ago.
New patch file to use videocast and videometadatacast tables
mythvideo-cast-new.2.diff (42.1 KB) - added by maverik044 <level42@…> 12 years ago.
Updated for SVN 14755
mythvideo-cast.2.diff (46.4 KB) - added by Bill <level42@…> 12 years ago.
Updated for SVN 15223
mythvideo-cast.3.diff (44.1 KB) - added by Bill <level42@…> 12 years ago.
Updated for SVN15419
mythvideo-cast.4.diff (44.5 KB) - added by Bill <level42@…> 12 years ago.
Updated patch see comment

Download all attachments as: .zip

Change History (21)

Changed 12 years ago by maverik044

Attachment: mythvideo-cast.diff added

Changed 12 years ago by maverik044

Attachment: get_cast.py added

Script to fill cast info for existing videos. Need to have python and python-imdbpy installed. See imdbpw.py script for more info.

comment:1 Changed 12 years ago by Rob Smith

Description: modified (diff)

double enter gives a newline in tracland. just making this a tad easier to read

comment:2 Changed 12 years ago by Anduin Withers

I've not committed this yet because I was going to rework it to use a videocast table (more like genres). I will do it eventually but if a new patch that does this were to appear on this ticket before then...

comment:3 Changed 12 years ago by maverik044 <level42@…>

I am the author of the patch, I will do the update to add videocast table. Good idea will allow for flexibility in the future for searching and filtering.

It will take me about a week or so to complete.

comment:4 Changed 12 years ago by maverik044 <level42@…>

I've updated the patch, the new description is as follows:

Proposed patch to add cast (actors) information from IMDB to mythvideo.

  1. Database version is up'd to 1014 to add videocast and videometadatacast tables
  1. Adds "View Cast" button in menu that has "View Full Plot"
  1. Updates videomanager to get the cast information and put it in the database (note the script imdb.pl already gets the cast info). Cast information is inserted into videocast and videometadatacast tables.
  1. Adds cast textarea for themes. Existing themes are not impacted and do not need to be changed if "View Cast" button is enough for you. Use it if you want, otherwise the existing themes will look the same as before this patch. For me, I plan to change the "director" container to "cast" in my person theme.
  1. Theme file video-ui.xml to allow filtering on cast (actor/actress). I removed "inet" filtering, case I didn't see a need to filter on on the IMDB number and needed space for cast filtering. Note that some themes may override this file and need to be edited.
  1. Update imdbpy.py to get the cast info
  1. Correct to MythTV.py to get the database IP address properly from mysql.txt (This time its actually included in the patch!!)
  1. White space correction to imdb.pl for cast info.
  1. Updated MythTV.py to include two new functions for adding data to videocast and videometadatacast (used by new script, see next bullet.)
  1. new script get_cast.py which will add cast information for all the videos you already have in the database. This is handy for people like me that have more than 200 videos already in the database and have performed some custom editing of the imdb data. PLEASE BACKUP YOUR DATABASE FIRST. I've tested it on my collection of 300+ movies, but just in case. This script will only add the first 12 of the cast in the database. The Imdbpy library grabs all actors/actress not just the first bill as mythvideo's imdb.pl does.

The Imdb.py and get_cast.py don't deal with acents in actor/actress names properly. If someone knows how to fix this ... The imdb.pl script through mythvideo videomanager does not have a problem with accents.

Changed 12 years ago by maverik044 <level42@…>

Attachment: mythvideo-cast-new.diff added

New patch file to use videocast and videometadatacast tables

comment:5 Changed 12 years ago by maverik044 <level42@…>

Oh forgot one fix was applied, unrelated.

In videofilter.h, kFilterInetRefChanged and kFilterParentalLevelChanged where assigned the same value of (1 << 8). I assume they need to be unique.

If I'm wrong I'll remove it from the patch; if it needs to be a separate ticket I can remove it and add to a new ticket.

Changed 12 years ago by maverik044 <level42@…>

Attachment: mythvideo-cast-new.2.diff added

Updated for SVN 14755

Changed 12 years ago by Bill <level42@…>

Attachment: mythvideo-cast.2.diff added

Updated for SVN 15223

comment:6 Changed 12 years ago by Bill <level42@…>

Updated patch attached is for SVN 15223. Quite a number of changes were needed.

Changed 12 years ago by Bill <level42@…>

Attachment: mythvideo-cast.3.diff added

Updated for SVN15419

comment:7 Changed 12 years ago by Bill <level42@…>

Updated patch attached for SVN15419

comment:8 Changed 12 years ago by Anduin Withers

Milestone: unknown0.21

comment:9 Changed 12 years ago by Bill <level42@…>

There are a few minor issues with this patch that I am working on fixing. The main one is that the cast order is not always displayed in "first billed" order. I'm using the types defined in dbaccess.cpp (SingleValueImp? and MultiValueImp?) and I'm finding that sometimes if even the data is inserted in the database in the first billed order, the fill_from_db function of MultiValueImp? may not retrieve in the same order it was inserted. Still debugging this, but I may need to change to not use MultiValueImp? and directly access the database. Besides MultiValueImp? and SingleValueImp? load the entire table into memory for all videos which could be quite sizeable for the cast data unlike the Genre or Country data.

There's also seems to be an issue where only 14 of the 15 cast members listed on imdb are picked up (the imdb.pl script does get all of them). As the code is the same for Genre and Country this issue may also affect these also.

Hope to have an update this weekend.

Changed 12 years ago by Bill <level42@…>

Attachment: mythvideo-cast.4.diff added

Updated patch see comment

comment:10 Changed 12 years ago by Bill <level42@…>

updated patch to fix cast ordering when the videomanager fetches the data. Previously it would be displayed in reverse order. Also is a small fix to imdb.pl that allows it to fetch cast data for tv episodes.

Note that the cast order will be shown in reverse order after videomanager is used to fetch the data. You need to restart the frontend to fix this as some data is static in dbaccess.cpp. The problem is in the add function of MultiValueImp?, need to use push_front instead of push_back, but that function doesn't exist. Since this is minor, and is fixed by restarting the frontend I don't see a reason to fix it.

Note that this patch relies on the fact that the cast data is inserted into the database in first bill order, and that the database will return it this way. It works for me, if we find in the future this is not the case, I'll have to add a field to videometadatacast to indicate the cast order.

comment:11 Changed 12 years ago by danielk

Version: unknownhead

comment:12 Changed 12 years ago by Anduin Withers

(In [15906]) References #3585

First part of applying cast info patch contributed by Bill (level42 at sympatico ca).

  • Adds a "View Cast" button on the info popup menu.
  • Uses the cast information returned by a metadata retrieval script.

The patch was slightly modified, any bugs are my own.

Theme changes, added cast filter setting.

Part two will contain changes to the other core themes, and an updated MythTV.py/imdbpy.py.

comment:13 Changed 12 years ago by Anduin Withers

(In [15916]) References #3585

Update core themes to include cast filter option.

comment:14 Changed 12 years ago by Anduin Withers

Resolution: fixed
Status: newclosed

(In [15935]) Closes #3585 References #4600

Finishes off the cast info patch by adding the cast output to imdbpy.py.

Make minimal Python bindings available. Thanks to trisooma a xs4all nl and Hadley Rich for this.

Note: See TracTickets for help on using tickets.