Skip to content

Commit

Permalink
Lowercase 'e' in multi-episode split naming (#6910)
Browse files Browse the repository at this point in the history
* Lowercase 'e' in multi-episode split naming

* Fix tests

* Update changelog
  • Loading branch information
nmaggioni authored and p0psicles committed Jul 3, 2019
1 parent 1e8bb35 commit 8d6ed43
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased

#### New Features
- Added multi-episode naming style with lowercase `e` ([#6910](https://github.com/pymedusa/Medusa/pull/6910))

#### Improvements
- Converted the footer to a Vue component ([#4520](https://github.com/pymedusa/Medusa/pull/4520))
Expand Down
6 changes: 4 additions & 2 deletions medusa/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,17 @@
NAMING_DUPLICATE = 4
NAMING_LIMITED_EXTEND = 8
NAMING_SEPARATED_REPEAT = 16
NAMING_LIMITED_EXTEND_E_PREFIXED = 32
NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED = 32
NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED = 64

MULTI_EP_STRINGS = {
NAMING_REPEAT: 'Repeat',
NAMING_SEPARATED_REPEAT: 'Repeat (Separated)',
NAMING_DUPLICATE: 'Duplicate',
NAMING_EXTEND: 'Extend',
NAMING_LIMITED_EXTEND: 'Extend (Limited)',
NAMING_LIMITED_EXTEND_E_PREFIXED: 'Extend (Limited, E-prefixed)'
NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED: 'Extend (Limited, E-prefixed)',
NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED: 'Extend (Limited, e-prefixed)'
}


Expand Down
12 changes: 8 additions & 4 deletions medusa/tv/episode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
NAMING_DUPLICATE,
NAMING_EXTEND,
NAMING_LIMITED_EXTEND,
NAMING_LIMITED_EXTEND_E_PREFIXED,
NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED,
NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED,
NAMING_SEPARATED_REPEAT,
Quality,
SKIPPED,
Expand Down Expand Up @@ -1667,7 +1668,7 @@ def _format_pattern(self, pattern=None, multi=None, anime_type=None):
sep = ' '

# force 2-3-4 format if they chose to extend
if multi in (NAMING_EXTEND, NAMING_LIMITED_EXTEND, NAMING_LIMITED_EXTEND_E_PREFIXED):
if multi in (NAMING_EXTEND, NAMING_LIMITED_EXTEND, NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED, NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED):
ep_sep = '-'

regex_used = season_ep_regex
Expand All @@ -1692,7 +1693,7 @@ def _format_pattern(self, pattern=None, multi=None, anime_type=None):
for other_ep in self.related_episodes:

# for limited extend we only append the last ep
if multi in (NAMING_LIMITED_EXTEND, NAMING_LIMITED_EXTEND_E_PREFIXED) and \
if multi in (NAMING_LIMITED_EXTEND, NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED, NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED) and \
other_ep != self.related_episodes[-1]:
continue

Expand All @@ -1706,9 +1707,12 @@ def _format_pattern(self, pattern=None, multi=None, anime_type=None):
# add "E04"
ep_string += ep_sep

if multi == NAMING_LIMITED_EXTEND_E_PREFIXED:
if multi == NAMING_LIMITED_EXTEND_E_UPPER_PREFIXED:
ep_string += 'E'

elif multi == NAMING_LIMITED_EXTEND_E_LOWER_PREFIXED:
ep_string += 'e'

ep_string += other_ep.__format_string(ep_format.upper(), other_ep.__replace_map())

if anime_type != 3:
Expand Down
5 changes: 3 additions & 2 deletions themes-default/slim/test/__fixtures__/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@
"createMissingShowDirs": true,
"nfoRename": true,
"multiEpStrings": {
"32": "Extend (Limited, E-prefixed)",
"1": "Repeat",
"2": "Extend",
"4": "Duplicate",
"8": "Extend (Limited)",
"16": "Repeat (Separated)"
"16": "Repeat (Separated)",
"32": "Extend (Limited, E-prefixed)",
"64": "Extend (Limited, e-prefixed)"
},
"airdateEpisodes": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ exports[`ConfigPostProcessing.test.js renders 1`] = `
enabled="true"
flagloaded="true"
multiepstyle="16"
multiepstyles="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
multiepstyles="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
namingpattern="Season %S/%S.N.S%0SE%0E.%RT.%SQ.N-%RG"
namingpresets="[object Object],[object Object],[object Object],[object Object],[object Object]"
type=""
Expand Down Expand Up @@ -869,7 +869,7 @@ exports[`ConfigPostProcessing.test.js renders 1`] = `
class="component-item"
flagloaded="true"
multiepstyle="1"
multiepstyles="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
multiepstyles="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
namingpattern="%SN - S%0SE%0E - [%QN] [%RG]"
namingpresets="[object Object],[object Object],[object Object],[object Object],[object Object]"
type="anime"
Expand Down

0 comments on commit 8d6ed43

Please sign in to comment.