Skip to content

Commit

Permalink
Merge pull request #7900 from pymedusa/release/release-0.3.14
Browse files Browse the repository at this point in the history
Release/release 0.3.14
  • Loading branch information
medariox authored Mar 30, 2020
2 parents fc471d2 + 131ad31 commit 4d1e787
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 162 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.3.14 (2020-03-30)

#### Improvements
- Search sub-folders for subtitles during post-processing

#### Fixes
- Fixed a bug that prevented the scheduler to run correctly

-----

## 0.3.13 (2020-03-28)

#### Improvements
Expand Down
2 changes: 1 addition & 1 deletion medusa/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
log.logger.addHandler(logging.NullHandler())

INSTANCE_ID = text_type(uuid.uuid1())
VERSION = '0.3.13'
VERSION = '0.3.14'
USER_AGENT = 'Medusa/{version} ({system}; {release}; {instance})'.format(
version=VERSION, system=platform.system(), release=platform.release(),
instance=INSTANCE_ID)
Expand Down
30 changes: 17 additions & 13 deletions medusa/post_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ def list_associated_files(self, file_path, subfolders=False, subtitles_only=Fals
if found_file == file_path:
continue

# Exclude .rar files
if re.search(r'(^.+\.(rar|r\d+)$)', found_file):
continue

# Exclude non-subtitle files with the 'only subtitles' option
if subtitles_only and not is_subtitle(found_file):
continue

# Exclude .rar files
if re.search(r'(^.+\.(rar|r\d+)$)', found_file):
continue

file_name = os.path.basename(found_file).lower()
if file_name.startswith(processed_names):
associated_files.add(found_file)
Expand Down Expand Up @@ -435,12 +435,16 @@ def _combined_file_operation(self, file_path, new_path, new_basename, associated
self.log(u'Must provide an action for the combined file operation', logger.ERROR)
return

file_list = [file_path]
other_files = []
if associated_files:
file_list += self.list_associated_files(file_path, refine=True)
elif subtitles:
file_list += self.list_associated_files(file_path, subtitles_only=True, refine=True)

other_files += self.list_associated_files(file_path, refine=True)
if subtitles:
other_files += self.list_associated_files(file_path, subfolders=True, subtitles_only=True, refine=True)
# Remove possible duplicates
if associated_files:
other_files = list(set(other_files))

file_list = [file_path] + other_files
if not file_list:
self.log(u'There were no files associated with {0}, not moving anything'.format
(file_path), logger.DEBUG)
Expand Down Expand Up @@ -521,8 +525,8 @@ def reflink(cur_file_path, new_file_path):
action = {'copy': copy, 'move': move, 'hardlink': hardlink, 'symlink': symlink, 'reflink': reflink}.get(self.process_method)
# Subtitle action should be move in case of hardlink|symlink|reflink as downloaded subtitle is not part of torrent
subtitle_action = {'copy': copy, 'move': move, 'hardlink': move, 'symlink': move, 'reflink': move}.get(self.process_method)
self._combined_file_operation(file_path, new_path, new_basename, associated_files,
action=action, subtitle_action=subtitle_action, subtitles=subtitles)
self._combined_file_operation(file_path, new_path, new_basename, associated_files=associated_files,
action=action, subtitles=subtitles, subtitle_action=subtitle_action)

@staticmethod
def _build_anidb_episode(connection, file_path):
Expand Down Expand Up @@ -1230,8 +1234,8 @@ def process(self):
if helpers.is_file_locked(self.file_path, False):
raise EpisodePostProcessingFailedException('File is locked for reading')

self.post_process_action(self.file_path, dest_path, new_base_name,
app.MOVE_ASSOCIATED_FILES, app.USE_SUBTITLES and ep_obj.series.subtitles)
self.post_process_action(self.file_path, dest_path, new_base_name, bool(app.MOVE_ASSOCIATED_FILES),
app.USE_SUBTITLES and bool(ep_obj.series.subtitles))
else:
logger.log(u"'{0}' is an unknown file processing method. "
u"Please correct your app's usage of the API.".format(self.process_method), logger.WARNING)
Expand Down
2 changes: 1 addition & 1 deletion medusa/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run(self):
should_run = True

# check if interval has passed
elif time_left.seconds <= 0:
elif time_left.total_seconds() <= 0:
should_run = True

if should_run:
Expand Down
4 changes: 2 additions & 2 deletions themes-default/slim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"eslint-config-xo": "0.26.0",
"eslint-import-resolver-webpack": "0.12.1",
"eslint-plugin-eslint-comments": "3.1.2",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-unicorn": "10.0.0",
"eslint-plugin-vue": "6.2.2",
Expand All @@ -88,7 +88,7 @@
"gulp-changed": "4.0.2",
"gulp-imagemin": "7.1.0",
"imagemin-pngquant": "8.0.0",
"jest": "25.2.3",
"jest": "25.2.4",
"jest-serializer-vue": "2.0.2",
"mini-css-extract-plugin": "0.9.0",
"nyc": "15.0.0",
Expand Down
Loading

0 comments on commit 4d1e787

Please sign in to comment.