[mythtv-commits] Ticket #13159: Automatic lookup of metadata should prefer exact title match over partial title matches

MythTV noreply at mythtv.org
Sun Nov 26 07:20:52 UTC 2017


#13159: Automatic lookup of metadata should prefer exact title match over partial
title matches
------------------------------------------------+--------------------------
 Reporter:  Steve Erlenborn <simon.sinister@…>  |          Owner:  pbennett
     Type:  Patch - Bug Fix                     |         Status:  assigned
 Priority:  minor                               |      Milestone:  30.0
Component:  MythTV - Mythmetadatalookup         |        Version:  Master
                                                |  Head
 Severity:  medium                              |     Resolution:
 Keywords:  metadata                            |  Ticket locked:  0
------------------------------------------------+--------------------------

Comment (by Steve Erlenborn <simon.sinister@…>):

 Thanks for the example case. I've added it to my list of example cases
 which need to be handled.


 ''Tomorrowland  [A George Clooney movie]
         - A partial match on TV show "Miles From Tomorrowland", with
 artwork
         - One exact match on movie, with artwork   <----- This is the one
 we want

 How to Marry a Millionaire    [A Marilyn Monroe movie]
         - An exact match on TV, with no artwork. The release date is later
 than the movie.
         - An exact match on Movie, with beautiful artwork. <----- This is
 the one we want

 Valor   [A 2017 television series]
         - One TV show with an exact title match <----- This is the one we
 want
         - Several movies with partial title matches

 Supergirl   [A recent television series]
         - One TV series with an exact match. <----- This is the one we
 want
         - Two movies with exact title matches.

 Go West    [A Marx Brothers movie]
         - One partial match on TV show, with no artwork
         - Four movies match exactly. The Marx Brothers movie is the most
 popular. <----- This is the one we want

 Molly & Wors
         - One TV show matches exactly, but it has no artwork. <----- This
 is the one we want
         - One movie partially matches, and has artwork''

 I've updated my patch to remove the blocks of code I previously added,
 which removed list elements with no artwork. Based on your feedback, that
 design was flawed. I've come up with an alternative solution, by adding a
 new method called findExactMatchCount(). This routine can be invoked to
 count exact matches, or exact matches with artwork.


 When a recording is expected to be a television series, we retrieve the
 count of exact matches in the television database with artwork. If that
 number is zero, then we add movies to the list of possible solutions. When
 a recording is expected to be a movie, we retrieve the count of exact
 matches in the movie database with artwork. If that number is zero, then
 we add television shows to the list of possible solutions.

 The findBestMatch() method then looks for exact matches with artwork. If
 there are exact matches, but none have artwork, it will pick a solution
 without artwork. [This handles your "Molly & Wors" scenario]. I tried a
 solution where both television and movie databases were always searched,
 but this caused problems for my "Supergirl" scenario. The movie
 "Supergirl" was released later than the start of the television series.
 So, it works better to first try finding an exact match, with artwork, in
 the television database. In the "Supergirl" case, an exact match with
 artwork is found. So there's no need to add in the entries from the movie
 database.
 For the "How to Marry a Millionaire" scenario, a television search yields
 one exact match, but it has no artwork. The call to
 findExactMatchCount(*,*,true) returns 0 since there are no matches with
 artwork. So we do an additional search in the movie database, which finds
 the best solution.

 The "Go West" scenario was difficult. Originally, when there were multiple
 exact title matches, I'd pick the most recently released one. This works,
 but it did not retrieve the artwork for the movie I recorded. It picked
 artwork for a more recent movie using the same name. To "fix" this, I've
 modified the algorithm in findBestMatch() to pick the most popular exact
 title match. This works pretty well for movies. I found that the movie
 database tends to include a popularity value for most movies.
 Unfortunately, the television database usually doesn't include a
 popularity value. I had to implement a multi-pronged solution. If there
 are popularity values, it will pick the most popular movie. If it's
 selecting from television entries, they will all have popularity of 0.0,
 so it will then fall back to picking the one with the most recent release
 date.

 The GetPopularity() service wasn't really used before this. I found that
 it had been improperly implemented to return an '''unsigned int''' value.
 This didn't function very well since the database entries for movies have
 floating point values. To work around this, I've updated m_popularity to
 be of type '''float''', and have modified GetPopularity() to return a
 '''float'''.

 With these changes, all of my example cases are working the way I wanted.
 "Molly & Wors" now picks the television series, even though it has no
 artwork.

 Please try
 ''mythtv-13159-PreferExactTitleMatchesForMetadata4.patch'''''''' and let
 me know if you find any other scenarios which are not handled in a
 satisfactory manor.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13159#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list