Skip to content

Commit

Permalink
Merge pull request #5762 from pymedusa/release/release-0.2.13
Browse files Browse the repository at this point in the history
Release 0.2.13
  • Loading branch information
medariox authored Nov 21, 2018
2 parents a1d899b + d6023cd commit 54da0c7
Show file tree
Hide file tree
Showing 34 changed files with 538 additions and 162 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.2.13 (2018-11-21)

#### Improvements
- Improved perfect match for subtitles downloading by making it a bit less strict ([#5729](https://github.com/pymedusa/Medusa/issues/5729))

#### Fixes
- Fixed ImportError when using Download Station client ([#5748](https://github.com/pymedusa/Medusa/pull/5748))
- Fixed Torrent Search path option not being saved ([#5736](https://github.com/pymedusa/Medusa/pull/5736))
- Fixed adding anime release group when adding show ([#5749](https://github.com/pymedusa/Medusa/pull/5749))
- Fixed Pushover debug log causing BraceException ([#5759](https://github.com/pymedusa/Medusa/pull/5759))
- Fixed torrent method Downloadstation not selected after restart ([#5761](https://github.com/pymedusa/Medusa/pull/5761))

-----

## 0.2.12 (2018-11-16)

#### New Features
Expand Down
2 changes: 1 addition & 1 deletion medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def initialize(self, console_logging=True):
app.NZB_METHOD = check_setting_str(app.CFG, 'General', 'nzb_method', 'blackhole', valid_values=('blackhole', 'sabnzbd', 'nzbget'))
app.TORRENT_METHOD = check_setting_str(app.CFG, 'General', 'torrent_method', 'blackhole',
valid_values=('blackhole', 'utorrent', 'transmission', 'deluge',
'deluged', 'download_station', 'rtorrent', 'qbittorrent', 'mlnet'))
'deluged', 'downloadstation', 'rtorrent', 'qbittorrent', 'mlnet'))

app.DOWNLOAD_PROPERS = bool(check_setting_int(app.CFG, 'General', 'download_propers', 1))
app.PROPERS_SEARCH_DAYS = max(2, min(8, check_setting_int(app.CFG, 'General', 'propers_search_days', 2)))
Expand Down
2 changes: 1 addition & 1 deletion medusa/clients/torrent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_clients = [
'deluge',
'deluged',
'download_station',
'downloadstation',
'mlnet',
'qbittorrent',
'rtorrent',
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 @@
long = int

INSTANCE_ID = str(uuid.uuid1())
VERSION = '0.2.12'
VERSION = '0.2.13'
USER_AGENT = 'Medusa/{version} ({system}; {release}; {instance})'.format(
version=VERSION, system=platform.system(), release=platform.release(),
instance=INSTANCE_ID)
Expand Down
2 changes: 1 addition & 1 deletion medusa/notifiers/pushover.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _send_pushover(self, msg, title, sound=None, user_key=None, api_key=None, pr
args['device'] = ','.join(app.PUSHOVER_DEVICE)

log.debug('PUSHOVER: Sending notice with details: title="{0}" message="{1}", priority={2}, sound={3}',
args['title'], args['message'], priority, sound)
title, msg, priority, sound)

conn = HTTPSConnection('api.pushover.net:443')
conn.request('POST', '/1/messages.json',
Expand Down
12 changes: 8 additions & 4 deletions medusa/server/api/v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ConfigHandler(BaseRequestHandler):
'clients.torrents.labelAnime': StringField(app, 'TORRENT_LABEL_ANIME'),
'clients.torrents.method': StringField(app, 'TORRENT_METHOD'),
'clients.torrents.password': StringField(app, 'TORRENT_PASSWORD'),
'clients.torrents.path': BooleanField(app, 'TORRENT_PATH'),
'clients.torrents.path': StringField(app, 'TORRENT_PATH'),
'clients.torrents.paused': BooleanField(app, 'TORRENT_PAUSED'),
'clients.torrents.rpcurl': StringField(app, 'TORRENT_RPCURL'),
'clients.torrents.seedLocation': StringField(app, 'TORRENT_SEED_LOCATION'),
Expand Down Expand Up @@ -210,9 +210,9 @@ class ConfigHandler(BaseRequestHandler):
'notifiers.plex.server.updateLibrary': BooleanField(app, 'PLEX_UPDATE_LIBRARY'),
'notifiers.plex.server.host': ListField(app, 'PLEX_SERVER_HOST'),
'notifiers.plex.server.https': BooleanField(app, 'PLEX_SERVER_HTTPS'),
'notifiers.plex.server.username': StringField(app, 'PLEX_SERVER_HOST'),
'notifiers.plex.server.password': StringField(app, 'PLEX_SERVER_HOST'),
'notifiers.plex.server.token': StringField(app, 'PLEX_SERVER_HOST'),
'notifiers.plex.server.username': StringField(app, 'PLEX_SERVER_USERNAME'),
'notifiers.plex.server.password': StringField(app, 'PLEX_SERVER_PASSWORD'),
'notifiers.plex.server.token': StringField(app, 'PLEX_SERVER_TOKEN'),
'notifiers.plex.client.enabled': BooleanField(app, 'USE_PLEX_CLIENT'),
'notifiers.plex.client.username': StringField(app, 'PLEX_CLIENT_USERNAME'),
'notifiers.plex.client.host': ListField(app, 'PLEX_CLIENT_HOST'),
Expand Down Expand Up @@ -932,6 +932,7 @@ def data_clients():
section_data['torrents']['seedLocation'] = app.TORRENT_SEED_LOCATION
section_data['torrents']['seedTime'] = app.TORRENT_SEED_TIME
section_data['torrents']['username'] = app.TORRENT_USERNAME
section_data['torrents']['password'] = app.TORRENT_PASSWORD
section_data['torrents']['verifySSL'] = bool(app.TORRENT_VERIFY_CERT)

section_data['nzb'] = NonEmptyDict()
Expand All @@ -947,6 +948,7 @@ def data_clients():
section_data['nzb']['nzbget']['priority'] = int(app.NZBGET_PRIORITY)
section_data['nzb']['nzbget']['useHttps'] = bool(app.NZBGET_USE_HTTPS)
section_data['nzb']['nzbget']['username'] = app.NZBGET_USERNAME
section_data['nzb']['nzbget']['password'] = app.NZBGET_PASSWORD

section_data['nzb']['sabnzbd'] = NonEmptyDict()
section_data['nzb']['sabnzbd']['category'] = app.SAB_CATEGORY
Expand All @@ -956,5 +958,7 @@ def data_clients():
section_data['nzb']['sabnzbd']['forced'] = bool(app.SAB_FORCED)
section_data['nzb']['sabnzbd']['host'] = app.SAB_HOST
section_data['nzb']['sabnzbd']['username'] = app.SAB_USERNAME
section_data['nzb']['sabnzbd']['password'] = app.SAB_PASSWORD
section_data['nzb']['sabnzbd']['apiKey'] = app.SAB_APIKEY

return section_data
4 changes: 4 additions & 0 deletions medusa/server/web/home/add_shows.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,12 @@ def finishAddShow():
subtitles = config.checkbox_to_value(subtitles)

if whitelist:
if not isinstance(whitelist, list):
whitelist = [whitelist]
whitelist = short_group_names(whitelist)
if blacklist:
if not isinstance(blacklist, list):
blacklist = [blacklist]
blacklist = short_group_names(blacklist)

if not allowed_qualities:
Expand Down
2 changes: 1 addition & 1 deletion medusa/server/web/manage/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def manageTorrents(self):

if app.TORRENT_METHOD == 'utorrent':
webui_url = '/'.join(s.strip('/') for s in (webui_url, 'gui/'))
if app.TORRENT_METHOD == 'download_station':
if app.TORRENT_METHOD == 'downloadstation':
if helpers.check_url('{url}download/'.format(url=webui_url)):
webui_url += 'download/'
else:
Expand Down
9 changes: 4 additions & 5 deletions medusa/subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,18 +563,17 @@ def merge_subtitles(existing_subtitles, new_subtitles):
def get_min_score():
"""Return the min score to be used by subliminal.
Perfect match = hash - resolution (subtitle for 720p is the same as for 1080p) - video_codec - audio_codec
Perfect match = series + year + season + episode + release_group
Non-perfect match = series + year + season + episode
:return: min score to be used to download subtitles
:rtype: int
"""
min_score = episode_scores['series'] + episode_scores['year'] + episode_scores['season'] + episode_scores['episode']
if app.SUBTITLES_PERFECT_MATCH:
return episode_scores['hash'] - (episode_scores['resolution'] +
episode_scores['video_codec'] +
episode_scores['audio_codec'])
min_score += episode_scores['release_group']

return episode_scores['series'] + episode_scores['year'] + episode_scores['season'] + episode_scores['episode']
return min_score


def get_current_subtitles(tv_episode):
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"devDependencies": {
"dredd": "5.2.0",
"execa": "1.0.0",
"yargs": "12.0.2"
"yargs": "12.0.5"
}
}
22 changes: 22 additions & 0 deletions tests/test_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,28 @@ def test_merge_subtitles__with_multi_disabled_and_single_new_language(monkeypatc
assert ['eng', 'pob', 'und'] == actual


def test_get_min_score__with_perfect_match_enabled(monkeypatch):
# Given
monkeypatch.setattr(app, 'SUBTITLES_PERFECT_MATCH', True)

# When
actual = sut.get_min_score()

# Then
assert 345 == actual


def test_get_min_score__with_perfect_match_disabled(monkeypatch):
# Given
monkeypatch.setattr(app, 'SUBTITLES_PERFECT_MATCH', False)

# When
actual = sut.get_min_score()

# Then
assert 330 == actual


def test_get_subtitles_dir__no_subtitles_dir(monkeypatch):
# Given
monkeypatch.setattr(app, 'SUBTITLES_DIR', '')
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"vue-template-compiler": "2.5.17",
"vue-truncate-collapsed": "2.1.0",
"vuex": "3.0.1",
"webpack": "4.25.1",
"webpack": "4.26.0",
"webpack-cli": "3.1.2",
"xo": "0.23.0"
},
Expand Down
18 changes: 12 additions & 6 deletions themes-default/slim/src/components/add-show-options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>

<div v-if="subtitlesEnabled" id="use-subtitles">
<config-toggle-slider label="Subtitles" id="subtitles" :value="defaultConfig.subtitles" @input="selectedSubtitleEnabled = $event"
<config-toggle-slider label="Subtitles" id="subtitles" :value="selectedSubtitleEnabled" @input="selectedSubtitleEnabled = $event"
:explanations="['Download subtitles for this show?']">
</config-toggle-slider>
</div>
Expand Down Expand Up @@ -44,12 +44,12 @@
</div>
</div>

<config-toggle-slider label="Season Folders" id="season_folders" :value="defaultConfig.seasonFolders || namingForceFolders" :disabled="namingForceFolders"
<config-toggle-slider label="Season Folders" id="season_folders" :value="selectedSeasonFoldersEnabled" :disabled="namingForceFolders"
:explanations="['Group episodes by season folders?']" @input="selectedSeasonFoldersEnabled = $event">
</config-toggle-slider>

<config-toggle-slider v-if="enableAnimeOptions" label="Anime" id="anime"
:explanations="['Is this show an Anime?']" :value="defaultConfig.anime" @input="selectedAnimeEnabled = $event">
:explanations="['Is this show an Anime?']" :value="selectedAnimeEnabled" @input="selectedAnimeEnabled = $event">
</config-toggle-slider>

<div v-if="enableAnimeOptions && selectedAnimeEnabled" class="form-group">
Expand All @@ -65,7 +65,7 @@
</div>
</div>

<config-toggle-slider label="Scene Numbering" id="scene" :value="defaultConfig.scene"
<config-toggle-slider label="Scene Numbering" id="scene" :value="selectedSceneEnabled"
:explanations="['Is this show scene numbered?']" @input="selectedSceneEnabled = $event">
</config-toggle-slider>

Expand Down Expand Up @@ -138,7 +138,8 @@ export default {
vm.selectedStatusAfter,
vm.selectedSubtitleEnabled,
vm.selectedSeasonFoldersEnabled,
vm.selectedSceneEnabled
vm.selectedSceneEnabled,
vm.selectedAnimeEnabled
].join(), () => {
this.update();
});
Expand Down Expand Up @@ -264,7 +265,6 @@ export default {
enableAnimeOptions,
defaultConfig,
namingForceFolders,
selectedStatus,
selectedStatusAfter,
combinedQualities,
Expand Down Expand Up @@ -305,6 +305,7 @@ export default {
},
release: {
handler() {
this.$emit('refresh');
this.update();
},
deep: true,
Expand All @@ -327,8 +328,13 @@ export default {
this.update();
},
defaultConfig(newValue) {
const { namingForceFolders } = this;
this.selectedStatus = newValue.status;
this.selectedStatusAfter = newValue.statusAfter;
this.selectedSubtitleEnabled = newValue.subtitles;
this.selectedAnimeEnabled = newValue.anime;
this.selectedSeasonFoldersEnabled = newValue.seasonFolders || namingForceFolders;
this.selectedSceneEnabled = newValue.scene;
}
}
};
Expand Down
6 changes: 3 additions & 3 deletions themes-default/slim/src/store/modules/clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const state = {
seedLocation: null,
seedTime: null,
username: null,
password: null,
verifySSL: null,
testStatus: 'Click below to test'
},
Expand All @@ -31,7 +32,7 @@ const state = {
priority: null,
useHttps: null,
username: null,
testStatus: 'Click below to test'
password: null
},
sabnzbd: {
category: null,
Expand All @@ -42,8 +43,7 @@ const state = {
host: null,
username: null,
password: null,
apiKey: null,
testStatus: 'Click below to test'
apiKey: null
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/views/config_notifications.mako
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ window.app = new Vue({
<fieldset class="component-group-list">
<!-- All form components here for plex media server -->
<config-toggle-slider v-model="notifiers.plex.server.enabled" label="Enable" id="use_plex_server" :explanations="['Send KODI commands?']" @change="save()" ></config-toggle-slider>
<config-toggle-slider v-model="notifiers.plex.server.enabled" label="Enable" id="use_plex_server" :explanations="['Send Plex server notifications?']" @change="save()" ></config-toggle-slider>
<div v-show="notifiers.plex.server.enabled" id="content-use-plex-server"> <!-- show based on notifiers.plex.server.enabled -->
<config-textbox v-model="notifiers.plex.server.token" label="Plex Media Server Auth Token" id="plex_server_token" @change="save()" >
Expand Down
Loading

0 comments on commit 54da0c7

Please sign in to comment.