-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying remap rules for media info #214
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WIP Schema and sample file (to be stored as # Sample trakt scrobbler remap file.
# schema:
# there should be a toplevel key "rules", which is a list of the following-
# [match]
# - one or more of path, title, season, episode, year
# - path should be valid a Python regex pattern
# - you can also capture substrings using "(?P<name>pattern)" syntax. These will override the default-extracted values from guessit.
# - season, episode, year support ranges.
# - For instance, 'season: "1:3,5"' will match any season in {1,2,3,5}
# - if needed, we can add a "fuzzy-title" in the future to do edit-distance based matching
# - specifying multiple fields means all of them should match.
# [type]
# - one of "episode" or "movie"
# [id]
# - one of trakt_slug, trakt_id, or title (to select top result)
# - can use placeholders for extracted values like "{episode}", "{title}", "{year}", etc.
# - the placeholder names should match the extracted guessit keys or regex capture group names
# - "title" can contain an optional year inside parentheses. Eg: "The Man from Earth (2007)"
# [season]
# - optional. If not provided, the extracted value from path/regex will be used.
# - any number starting from 0
# - 0 corresponds to "Specials" season on Trakt
# [episode_delta]
# - optional. Default is 0
# - any integer (positive or negative)
# - will be added to the episode number extracted from path/regex
# for this sample, the match paths correspond to the Monogatari torrent v2 from DB encodes.
[[rules]]
match.path = ".*/01 Bakemonogatari/.*"
match.episode = "1:12"
id.trakt_slug = "monogatari"
type = "episode"
season = 1
[[rules]]
match.path = ".*/01 Bakemonogatari/.*"
match.episode = "13:15"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = -11
[[rules]]
match.path = ".*/Kizumonogatari/.*"
id.title = "Kizumonogatari Part {episode}"
type = "movie"
[[rules]]
match.path = ".*/02 Nisemonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 2
[[rules]]
match.path = ".*/03 Nekomonogatari (Kuro)/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 5
[[rules]]
match.path = ".*/Arc 01 Nekomonogatari Shiro/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 3
[[rules]]
match.path = ".*/Arc 02 Kabukimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 3
episode_delta = 5
[[rules]]
match.path = ".*/Arc 06 Hanamonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 12
[[rules]]
match.path = ".*/Arc 03 Otorimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 3
episode_delta = 9
[[rules]]
match.path = ".*/Arc 04 Onimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 3
episode_delta = 13
[[rules]]
match.path = ".*/Arc 05 Koimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 3
episode_delta = 17
[[rules]]
match.path = ".*/01 Tsukimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 17
[[rules]]
match.path = ".*/03 Koyomimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 21
[[rules]]
match.path = ".*/02 Owarimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 4
[[rules]]
match.path = ".*/04 Owarimonogatari Second Season/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 34
[[rules]]
match.path = ".*/05 Zoku Owarimonogatari/.*"
id.trakt_slug = "monogatari"
type = "episode"
season = 0
episode_delta = 41 |
LGTM... Works on my machine™ XD p.s. I'm moved beyond words by the fact that you didn't use yaml for this /s |
Alright, this seems to be working well enough for me too. |
ahmubashshir
approved these changes
Oct 14, 2022
This was referenced Mar 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #95