Score

This module is responsible for calculating the scores dicts (Episode.scores and Movie.scores) by assigning a score to a match.

Note

To avoid unnecessary dependency on sympy and boost subliminal’s import time, the resulting scores are hardcoded in their respective classes and manually updated when the set of equations change.

Available matches:

  • hearing_impaired
  • format
  • release_group
  • resolution
  • video_codec
  • audio_codec
  • imdb_id
  • hash
  • title
  • year
  • series
  • season
  • episode
  • tvdb_id

The Subtitle.get_matches method get the matches between the Subtitle and the Video and compute_score() computes the score.

subliminal.score.solve_episode_equations()[source]

Solve the score equations for an Episode.

The equations are the following:

  1. hash = resolution + format + video_codec + audio_codec + series + season + episode + year + release_group
  2. series = resolution + video_codec + audio_codec + season + episode + release_group + 1
  3. year = series
  4. tvdb_id = series + year
  5. season = resolution + video_codec + audio_codec + 1
  6. imdb_id = series + season + episode + year
  7. format = video_codec + audio_codec
  8. resolution = video_codec
  9. video_codec = 2 * audio_codec
  10. title = season + episode
  11. season = episode
  12. release_group = season
  13. audio_codec = 2 * hearing_impaired
  14. hearing_impaired = 1
Returns:the result of the equations.
Return type:dict
subliminal.score.solve_movie_equations()[source]

Solve the score equations for a Movie.

The equations are the following:

  1. hash = resolution + format + video_codec + audio_codec + title + year + release_group
  2. imdb_id = hash
  3. resolution = video_codec
  4. video_codec = 2 * audio_codec
  5. format = video_codec + audio_codec
  6. title = resolution + video_codec + audio_codec + year + 1
  7. release_group = resolution + video_codec + audio_codec + 1
  8. year = release_group + 1
  9. audio_codec = 2 * hearing_impaired
  10. hearing_impaired = 1
Returns:the result of the equations.
Return type:dict