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:
- hash = resolution + format + video_codec + audio_codec + series + season + episode + year + release_group
- series = resolution + video_codec + audio_codec + season + episode + release_group + 1
- year = series
- tvdb_id = series + year
- season = resolution + video_codec + audio_codec + 1
- imdb_id = series + season + episode + year
- format = video_codec + audio_codec
- resolution = video_codec
- video_codec = 2 * audio_codec
- title = season + episode
- season = episode
- release_group = season
- audio_codec = 2 * hearing_impaired
- 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:
- hash = resolution + format + video_codec + audio_codec + title + year + release_group
- imdb_id = hash
- resolution = video_codec
- video_codec = 2 * audio_codec
- format = video_codec + audio_codec
- title = resolution + video_codec + audio_codec + year + 1
- release_group = resolution + video_codec + audio_codec + 1
- year = release_group + 1
- audio_codec = 2 * hearing_impaired
- hearing_impaired = 1
Returns: the result of the equations. Return type: dict