Skip to content

Commit

Permalink
Rename alternativeTitle to alternative_title and add it to docs
Browse files Browse the repository at this point in the history
Close #253
  • Loading branch information
Toilal committed Jan 18, 2016
1 parent 95dd3c4 commit 8114ae6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Main properties

Title of movie or episode.

- **alternative_title**

Other titles found for movie.

- **container**

Container of the file.
Expand Down
2 changes: 1 addition & 1 deletion guessit/rules/common/comparators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def marker_comparator_predicate(match):
Match predicate used in comparator
"""
return not match.private and \
match.name not in ['proper_count', 'title', 'episode_title', 'alternativeTitle'] and \
match.name not in ['proper_count', 'title', 'episode_title', 'alternative_title'] and \
not (match.name == 'container' and 'extension' in match.tags)


Expand Down
2 changes: 1 addition & 1 deletion guessit/rules/properties/episode_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def when(self, matches, context):
if matches.named('episode_title'):
return

alternative_title = matches.range(predicate=lambda match: match.name == 'alternativeTitle', index=0)
alternative_title = matches.range(predicate=lambda match: match.name == 'alternative_title', index=0)
if alternative_title:
main_title = matches.chain_before(alternative_title.start, seps=seps,
predicate=lambda match: 'title' in match.tags, index=0)
Expand Down
2 changes: 1 addition & 1 deletion guessit/rules/properties/title.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class TitleFromPosition(TitleBaseRule):
properties = {'title': [None]}

def __init__(self):
super(TitleFromPosition, self).__init__('title', ['title'], 'alternativeTitle')
super(TitleFromPosition, self).__init__('title', ['title'], 'alternative_title')


class PreferTitleWithYear(Rule):
Expand Down
2 changes: 1 addition & 1 deletion guessit/test/episodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

? Series/Kaamelott/Kaamelott - Livre V - Ep 23 - Le Forfait.avi
: title: Kaamelott
alternativeTitle: Livre V
alternative_title: Livre V
episode: 23
episode_title: Le Forfait

Expand Down
7 changes: 4 additions & 3 deletions guessit/test/movies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@

? "Star Wars: Episode IV - A New Hope (2004) Special Edition.MKV"
: title: "Star Wars: Episode IV"
alternativeTitle: A New Hope
alternative_title: A New Hope
year: 2004
edition: Special Edition

Expand Down Expand Up @@ -632,18 +632,19 @@
release_group: CCATS
screen_size: 1080p
title: Echec et Mort
alternativeTitle:
alternative_title:
- Hard to Kill
- Steven Seagal
video_codec: h264

? Paparazzi - Timsit/Lindon (MKV 1080p tvripHD)
: options: -n
title: Paparazzi
alternativeTitle:
alternative_title:
- Timsit
- Lindon
screen_size: 1080p
container: MKV
format: HDTV

? some.movie.720p.bluray.x264-mind
Expand Down
2 changes: 1 addition & 1 deletion guessit/test/various.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
? OSS_117--Cairo,_Nest_of_Spies.mkv
: type: movie
title: OSS 117
alternativeTitle: Cairo, Nest of Spies
alternative_title: Cairo, Nest of Spies

? Rush.._Beyond_The_Lighted_Stage-x09-Between_Sun_and_Moon-2002_Hartford.mkv
: type: movie
Expand Down

0 comments on commit 8114ae6

Please sign in to comment.