Skip to content
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

Minor UI changes #5692

Merged
merged 8 commits into from
Nov 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,34 +95,6 @@
logger = logging.getLogger(__name__)


def fix_incorrect_list_values(data):
"""
@TODO: Remove this in a future version.

Due to a bug introduced in v0.2.9, the value might be a string representing a Python dict.
See: https://github.com/pymedusa/Medusa/issues/5155

Example: `"{u'id': 0, u'value': u'!sync'}"` to `"!sync"`
"""
import ast

result = []
for item in data:
if not item:
continue
if not (item.startswith('{') and item.endswith('}')):
# Simple value, don't do anything to it
result.append(item)
continue
try:
# Get the value: `{u'id': 0, u'value': u'!sync'}` => `!sync`
result.append(ast.literal_eval(item)['value'])
except (SyntaxError, KeyError):
pass

return result


class Application(object):
"""Main application module."""

Expand Down Expand Up @@ -616,11 +588,7 @@ def initialize(self, console_logging=True):
app.RANDOMIZE_PROVIDERS = bool(check_setting_int(app.CFG, 'General', 'randomize_providers', 0))
app.ALLOW_HIGH_PRIORITY = bool(check_setting_int(app.CFG, 'General', 'allow_high_priority', 1))
app.SKIP_REMOVED_FILES = bool(check_setting_int(app.CFG, 'General', 'skip_removed_files', 0))

app.ALLOWED_EXTENSIONS = check_setting_list(app.CFG, 'General', 'allowed_extensions', app.ALLOWED_EXTENSIONS)
# @TODO: Remove this in a future version.
app.ALLOWED_EXTENSIONS = fix_incorrect_list_values(app.ALLOWED_EXTENSIONS)

app.USENET_RETENTION = check_setting_int(app.CFG, 'General', 'usenet_retention', 500)
app.CACHE_TRIMMING = bool(check_setting_int(app.CFG, 'General', 'cache_trimming', 0))
app.MAX_CACHE_AGE = check_setting_int(app.CFG, 'General', 'max_cache_age', 30)
Expand Down Expand Up @@ -661,11 +629,7 @@ def initialize(self, console_logging=True):
app.MOVE_ASSOCIATED_FILES = bool(check_setting_int(app.CFG, 'General', 'move_associated_files', 0))
app.POSTPONE_IF_SYNC_FILES = bool(check_setting_int(app.CFG, 'General', 'postpone_if_sync_files', 1))
app.POSTPONE_IF_NO_SUBS = bool(check_setting_int(app.CFG, 'General', 'postpone_if_no_subs', 0))

app.SYNC_FILES = check_setting_list(app.CFG, 'General', 'sync_files', app.SYNC_FILES)
# @TODO: Remove this in a future version.
app.SYNC_FILES = fix_incorrect_list_values(app.SYNC_FILES)

app.NFO_RENAME = bool(check_setting_int(app.CFG, 'General', 'nfo_rename', 1))
app.CREATE_MISSING_SHOW_DIRS = bool(check_setting_int(app.CFG, 'General', 'create_missing_show_dirs', 0))
app.ADD_SHOWS_WO_DIR = bool(check_setting_int(app.CFG, 'General', 'add_shows_wo_dir', 0))
Expand Down Expand Up @@ -946,8 +910,6 @@ def initialize(self, console_logging=True):
app.NO_RESTART = bool(check_setting_int(app.CFG, 'General', 'no_restart', 0))

app.EXTRA_SCRIPTS = [x.strip() for x in check_setting_list(app.CFG, 'General', 'extra_scripts')]
# @TODO: Remove this in a future version.
app.EXTRA_SCRIPTS = fix_incorrect_list_values(app.EXTRA_SCRIPTS)

app.USE_LISTVIEW = bool(check_setting_int(app.CFG, 'General', 'use_listview', 0))

Expand Down
1 change: 0 additions & 1 deletion medusa/server/web/home/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,6 @@ def editShow(self, indexername=None, seriesid=None, location=None, allowed_quali
preferred_qualities = preferred_qualities or []
exceptions = exceptions_list or set()

anidb_failed = False
errors = 0

if not indexername or not seriesid:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ flake8-ignore =
medusa/server/web/home/add_recommended.py D100
medusa/server/web/home/add_shows.py D100 D101 D102 D200 D205 D400 D401 N802 N803 N806
medusa/server/web/home/change_log.py D100 D101 D102
medusa/server/web/home/handler.py D100 D101 D102 D202 D205 D210 D400 D401 E501 F841 N802 N803 N806
medusa/server/web/home/handler.py D100 D101 D102 D202 D205 D210 D400 D401 E501 N802 N803 N806
medusa/server/web/home/news.py D100 D101 D102
medusa/server/web/home/post_process.py D100 D101 D102 N802 N803
medusa/server/web/manage/__init__.py D104 F401
Expand Down
28 changes: 1 addition & 27 deletions themes-default/slim/src/components/app-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,6 @@ export default {
components: {
AppLink
},
data() {
return {
topMenuMapping: [
['system', ['/home/restart', '/home/status', '/errorlogs', '/changes', '/news', '/IRC']],
['home', ['/home', '/addShows', '/addRecommended']],
['config', ['/config']],
['history', ['/history']],
['schedule', ['/schedule']],
['manage', ['/manage']],
['login', ['/login']]
]
};
},
computed: {
...mapState([
'config',
Expand All @@ -147,20 +134,7 @@ export default {
});
},
topMenu() {
// This is a workaround, until we're able to use VueRouter to determine that.
// The possible `topmenu` values are: config, history, schedule, system, home, manage, login [unused]
const { topMenuMapping } = this;
const { pathname } = window.location;

for (const item of topMenuMapping) {
const [topMenu, routes] = item; // Unpacking
for (const route of routes) {
if (pathname.includes(route)) {
return topMenu;
}
}
}
return null;
return this.$route.meta.topMenu;
},
toolsBadgeCount() {
const { config } = this;
Expand Down
6 changes: 6 additions & 0 deletions themes-default/slim/src/components/helpers/app-link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:target="linkProperties.target"
:rel="linkProperties.rel"
:false-link="linkProperties.falseLink"
:class="{ 'router-link': linkProperties.is === 'router-link' }"
>
<slot></slot>
</component>
Expand Down Expand Up @@ -173,4 +174,9 @@ e.g. displayShow?indexername=tvdb&seriesid=83462#season-5
margin-top: -100px;
z-index: -100;
}

.router-link,
.router-link-active {
cursor: pointer;
}
</style>
Loading