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

Implemented Vue.js in the editShow.mako template. #3849

Merged
merged 70 commits into from
Apr 22, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
ad6875e
move quality-chooser to vue
OmgImAlexis Feb 28, 2018
44d378f
add js libs
OmgImAlexis Mar 1, 2018
e5c7bf3
fix form submitting
OmgImAlexis Mar 1, 2018
2dc8ced
Implemented Vue.js in the editShow.mako template.
p0psicles Mar 10, 2018
9a5084f
Added anidb release group blacklist/whitelist dogpile caching.
p0psicles Mar 11, 2018
1d13f3a
Added arrows for moving release groups to whitelist/blacklist.
p0psicles Mar 11, 2018
1a9d3f6
Added ability to manually add release groups.
p0psicles Mar 11, 2018
7c7d347
Fixed saving whitelist and blacklist
p0psicles Mar 11, 2018
f2c5021
Put back v-cloak.
p0psicles Mar 11, 2018
b4ebd68
Remove webHandler code for editShow.
p0psicles Mar 11, 2018
ebfa3b4
Fix the filebrowser.
p0psicles Mar 11, 2018
8ae7b52
move new vue component to vue-components dir
OmgImAlexis Mar 17, 2018
1b39e99
Moved the css To inline.
p0psicles Mar 17, 2018
815eceb
Merge remote-tracking branch 'remotes/origin/develop' into feature/co…
p0psicles Mar 22, 2018
62a431c
Removed classes on the file-browser component.
p0psicles Mar 22, 2018
897128f
rename qualityChooser file
OmgImAlexis Apr 7, 2018
4a8fc21
Merge remote-tracking branch 'remotes/origin/develop' into feature/co…
p0psicles Apr 9, 2018
581ac33
Fixed app-link. Already fixed in develop.
p0psicles Apr 9, 2018
30179fb
Updated the other themes.
p0psicles Apr 9, 2018
f9dd1be
Fix test
medariox Apr 11, 2018
5ede245
Pin pycodestyle to version 2.3.1
medariox Apr 11, 2018
bc8ffa9
Merge remote-tracking branch 'remotes/origin/feature/quality-chooser-…
p0psicles Apr 11, 2018
237d4ca
Added quality-chooser.mako include.
p0psicles Apr 11, 2018
2561e30
Merge branch 'feature/convert-editshow-to-vue' of https://github.com/…
p0psicles Apr 11, 2018
b7db40d
Fix apiv2 tests
medariox Apr 11, 2018
08a4094
Merge remote-tracking branch 'origin/feature/convert-editshow-to-vue'…
medariox Apr 11, 2018
7f5d165
Remove the duplicate css for filebrowser component.
p0psicles Apr 11, 2018
54c800a
Remove module key from the indexer_config.py to_json method.
p0psicles Apr 11, 2018
1c21868
Merge branch 'feature/convert-editshow-to-vue' of https://github.com/…
p0psicles Apr 11, 2018
4798f4d
Flake8
medariox Apr 11, 2018
5f42c80
Merge remote-tracking branch 'origin/feature/convert-editshow-to-vue'…
medariox Apr 11, 2018
71eecfe
Flake8 (2)
medariox Apr 11, 2018
5a21fd9
fix typo
OmgImAlexis Apr 12, 2018
f7b0f20
Removed duplicate css from component directive.
p0psicles Apr 12, 2018
c8f247e
reviewed vue
OmgImAlexis Apr 13, 2018
ccfec58
fix typo
OmgImAlexis Apr 13, 2018
799a9f3
Tried adding a saved animation / modal.
p0psicles Apr 14, 2018
f90ab76
Add saved-animation.mako
p0psicles Apr 15, 2018
64a0265
Removed the data variables. Just use props.
p0psicles Apr 15, 2018
d0c5a5a
move quality-chooser to vue
OmgImAlexis Feb 28, 2018
2fb1227
add js libs
OmgImAlexis Mar 1, 2018
6d47906
fix form submitting
OmgImAlexis Mar 1, 2018
3a9468f
move new vue component to vue-components dir
OmgImAlexis Mar 17, 2018
d2a8944
rename qualityChooser file
OmgImAlexis Apr 7, 2018
0025309
Rename "preffered" to preferred
sharkykh Apr 16, 2018
f922905
Fix quality chooser (tested only on add new show page)
sharkykh Apr 16, 2018
e3f42b6
Remove imports of quality-chooser.js, remove map files
sharkykh Apr 16, 2018
a991017
Update files in the other themes
sharkykh Apr 16, 2018
134097a
More fixes
sharkykh Apr 16, 2018
d040822
Added saving series info language through apiv2.
p0psicles Apr 17, 2018
b7d5dce
Fixed saved-messages component.
p0psicles Apr 17, 2018
76e6e9b
Created jquery wrapper for the select languages select.
p0psicles Apr 17, 2018
ac94621
Removed files that where added by mistake.
p0psicles Apr 17, 2018
cf4c385
Merge remote-tracking branch 'remotes/origin/develop' into feature/co…
p0psicles Apr 17, 2018
9c5fc0d
Merge remote-tracking branch 'remotes/origin/feature/quality-chooser-…
p0psicles Apr 17, 2018
ef33062
Added saving qualities.
p0psicles Apr 18, 2018
cc5b57d
Update test
medariox Apr 19, 2018
42017fc
Remove session from indexer_config to_json method.
p0psicles Apr 19, 2018
32fa448
Always initialize a BlackWhite list object. Also for non-anime.
p0psicles Apr 19, 2018
c98a9f1
Fixed indexerIdToName function.
p0psicles Apr 19, 2018
a59cdbb
Fixed app-link indexerId.
p0psicles Apr 19, 2018
78baaff
remove series prop from anidb-release-group-ui.mako.
p0psicles Apr 19, 2018
76b64fe
Merge branch 'feature/convert-editshow-to-vue' of https://github.com/…
p0psicles Apr 19, 2018
ab35fa9
Merge remote-tracking branch 'remotes/origin/develop' into feature/co…
p0psicles Apr 19, 2018
565aaa0
Merge remote-tracking branch 'remotes/origin/develop' into feature/co…
p0psicles Apr 20, 2018
0514853
Sync dark/light themes from slim.
p0psicles Apr 20, 2018
c6ef568
Delete mynzb.nzb
sharkykh Apr 21, 2018
e2fe1f6
Fix the quality event handler / saving changed values.
p0psicles Apr 22, 2018
d91c64d
Merge branch 'feature/convert-editshow-to-vue' of https://github.com/…
p0psicles Apr 22, 2018
86ced83
Remove commented code.
p0psicles Apr 22, 2018
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
41 changes: 41 additions & 0 deletions medusa/indexers/indexer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Indexer config module."""
from __future__ import unicode_literals

from six import text_type
from medusa.app import BASE_PYMEDUSA_URL
from medusa.indexers.tmdb.tmdb import Tmdb
from medusa.indexers.tvdbv2.tvdbv2_api import TVDBv2
Expand Down Expand Up @@ -114,3 +115,43 @@
'identifier': 'tmdb', # Also used as key for the custom scenename exceptions. (_get_custom_exceptions())
}
}


def create_config_json(indexer):
"""Create a json (pickable) conpatible dict, for using as an apiv2 resource."""
return {
'enabled': indexer['enabled'],
'id': indexer['id'],
'name': indexer['name'],
'module': text_type(indexer['module']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0psicles What's the point of mapping the module? Can it be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think I started with just making 'it work', but I don't think we'll ever use that.

'apiParams': {
'language': indexer['api_params']['language'],
'useZip': indexer['api_params']['use_zip'],
'session': '',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is session needed if it's always empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no we can remove that

},
'xemOrigin': indexer.get('xem_origin'),
'icon': indexer.get('icon'),
'scene_loc': indexer.get('scene_loc'),
'baseUrl': indexer.get('base_url'),
'showUrl': indexer.get('show_url'),
'mappedTo': indexer.get('mapped_to'), # The attribute to which other indexers can map there thetvdb id to
'identifier': indexer.get('identifier'), # Also used as key for the custom scenename exceptions. (_get_custom_exceptions())
'validLanguages': initConfig['valid_languages'],
'langabbvToId': initConfig['langabbv_to_id'],
}


def get_indexer_config():
indexers = {
indexerConfig[indexer]['identifier']: create_config_json(indexerConfig[indexer]) for indexer in indexerConfig.keys()
}

main = {
'validLanguages': initConfig['valid_languages'],
'langabbvToId': initConfig['langabbv_to_id'],
'externalMappings': EXTERNAL_MAPPINGS,
'traktIndexers': TRAKT_INDEXERS,
'statusMap': STATUS_MAP
}

return {'indexers': indexers, 'main': main}
14 changes: 13 additions & 1 deletion medusa/server/api/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import base64
import collections
import json
import logging
import operator
import traceback
from builtins import object
Expand All @@ -22,6 +23,8 @@
from tornado.httpclient import HTTPError
from tornado.web import RequestHandler

log = logging.getLogger(__name__)


class BaseRequestHandler(RequestHandler):
"""A base class used for shared RequestHandler methods."""
Expand Down Expand Up @@ -398,7 +401,16 @@ def patch(self, target, value):
valid = True

if valid:
setattr(target, self.attr, self.converter(value))
try:
setattr(target, self.attr, self.converter(value))
except AttributeError:
log.warning(
'Error trying to change attribute %s on target %s, you sure you are allowed to change this attribute?',
self.attr,
target
)
return False

if self.post_processor:
self.post_processor(value)
return True
Expand Down
5 changes: 2 additions & 3 deletions medusa/server/api/v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
db,
)
from medusa.helper.mappings import NonEmptyDict
from medusa.indexers.indexer_config import indexerConfig
from medusa.indexers.indexer_config import get_indexer_config
from medusa.server.api.v2.base import (
BaseRequestHandler,
BooleanField,
Expand Down Expand Up @@ -183,8 +183,7 @@ def get(self, identifier, path_param=None):
config_data['backlogOverview']['period'] = app.BACKLOG_PERIOD
config_data['backlogOverview']['status'] = app.BACKLOG_STATUS
config_data['indexers'] = NonEmptyDict()
config_data['indexers']['config'] = {text_type(indexer_id): indexer['identifier'] for indexer_id,
indexer in iteritems(indexerConfig)}
config_data['indexers']['config'] = get_indexer_config()

if not identifier:
return self._paginate([config_data])
Expand Down
10 changes: 9 additions & 1 deletion medusa/server/api/v2/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from medusa.server.api.v2.base import (
BaseRequestHandler,
BooleanField,
ListField,
StringField,
iter_nested_items,
set_nested_value
Expand Down Expand Up @@ -113,13 +114,20 @@ def patch(self, series_slug, path_param=None):
accepted = {}
ignored = {}
patches = {
'config.aliases': ListField(series, 'aliases'),
'config.dvdOrder': BooleanField(series, 'dvd_order'),
'config.flattenFolders': BooleanField(series, 'flatten_folders'),
'config.anime': BooleanField(series, 'anime'),
'config.scene': BooleanField(series, 'scene'),
'config.sports': BooleanField(series, 'sports'),
'config.paused': BooleanField(series, 'paused'),
'config.location': StringField(series, '_location'),
'config.airByDate': BooleanField(series, 'air_by_date'),
'config.subtitlesEnabled': BooleanField(series, 'subtitles')
'config.subtitlesEnabled': BooleanField(series, 'subtitles'),
'config.release.requiredWords': ListField(series, 'release_required_words'),
'config.release.ignoredWords': ListField(series, 'release_ignore_words')
# 'config.release.blacklist': ListField(series, 'release_required_words'),
# 'config.release.whitelist': ListField(series, 'release_required_words'),
}
for key, value in iter_nested_items(data):
patch_field = patches.get(key)
Expand Down
26 changes: 23 additions & 3 deletions medusa/tv/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@
from medusa.media.fan_art import ShowFanArt
from medusa.media.network_logo import ShowNetworkLogo
from medusa.media.poster import ShowPoster
from medusa.name_cache import build_name_cache
from medusa.name_parser.parser import (
InvalidNameException,
InvalidShowException,
NameParser,
)
from medusa.sbdatetime import sbdatetime
from medusa.scene_exceptions import get_scene_exceptions
from medusa.scene_exceptions import get_scene_exceptions, update_scene_exceptions

from medusa.show.show import Show
from medusa.subtitles import (
code_from_code,
Expand All @@ -105,7 +107,7 @@
from medusa.tv.episode import Episode
from medusa.tv.indexer import Indexer

from six import itervalues, text_type, viewitems
from six import itervalues, string_types, text_type, viewitems

try:
from send2trash import send2trash
Expand Down Expand Up @@ -538,16 +540,31 @@ def aliases(self):
"""Return series aliases."""
return self.exceptions or get_scene_exceptions(self)

@aliases.setter
def aliases(self, exceptions):
"""Set the series aliases."""
self.exceptions = exceptions
update_scene_exceptions(self, exceptions)
build_name_cache(self)

@property
def release_ignore_words(self):
"""Return release ignore words."""
return [v for v in (self.rls_ignore_words or '').split(',') if v]

@release_ignore_words.setter
def release_ignore_words(self, value):
self.rls_ignore_words = value if isinstance(value, string_types) else ','.join(value)

@property
def release_required_words(self):
"""Return release ignore words."""
return [v for v in (self.rls_require_words or '').split(',') if v]

@release_required_words.setter
def release_required_words(self, value):
self.rls_require_words = value if isinstance(value, string_types) else ','.join(value)

@staticmethod
def normalize_status(series_status):
"""Return a normalized status given current indexer status."""
Expand Down Expand Up @@ -1997,6 +2014,7 @@ def to_json(self, detailed=True):
data['id'] = NonEmptyDict()
data['id'][self.indexer_name] = self.series_id
data['id']['imdb'] = text_type(self.imdb_id)
data['id']['slug'] = self.identifier.slug
data['title'] = self.name
data['indexer'] = self.indexer_name # e.g. tvdb
data['network'] = self.network # e.g. CBS
Expand Down Expand Up @@ -2034,7 +2052,9 @@ def to_json(self, detailed=True):
data['config']['subtitlesEnabled'] = bool(self.subtitles)
data['config']['dvdOrder'] = bool(self.dvd_order)
data['config']['flattenFolders'] = bool(self.flatten_folders)
data['config']['anime'] = self.is_anime
data['config']['scene'] = self.is_scene
data['config']['sports'] = self.is_sports
data['config']['paused'] = bool(self.paused)
data['config']['defaultEpisodeStatus'] = self.default_ep_status_name
data['config']['aliases'] = self.aliases
Expand Down Expand Up @@ -2076,7 +2096,7 @@ def get_all_possible_names(self, season=-1):
show: a Series object that we should get the names of
Returns: all possible show names
"""
show_names = get_scene_exceptions(self, season)
show_names = {exception.series_name for exception in get_scene_exceptions(self, season)}
show_names.add(self.name)

new_show_names = set()
Expand Down
15 changes: 15 additions & 0 deletions themes-default/slim/static/css/vue/anidbreleasegroupui.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* =========================================================================
Style for the anidbReleaseGroupUi.mako.
Should be moved from here, when moving the .vue files.
========================================================================== */

div#anidb_release_group_ui_wrapper {
clear: both;
}

div#anidb_release_group_ui_wrapper ul {
border-style: solid;
border-width: thin;
padding: 5px 2px 2px 5px;
list-style: none;
}
Empty file.
13 changes: 13 additions & 0 deletions themes-default/slim/static/css/vue/selectlistui.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* =========================================================================
Style for the selectList.mako.
Should be moved from here, when moving the .vue files.
========================================================================== */

div.select-list ul {
padding-left: 0;
}

div.select-list li {
list-style-type: none;
display: flex;
}
Binary file added themes-default/slim/static/images/pencil_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading