Skip to content

Commit

Permalink
Merge pull request #10326 from pymedusa/release/release-0.5.23
Browse files Browse the repository at this point in the history
Release/release 0.5.23
  • Loading branch information
p0psicles authored Feb 11, 2022
2 parents 1405fbb + 67d8524 commit dd0b950
Show file tree
Hide file tree
Showing 124 changed files with 9,304 additions and 4,343 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: docker buildx build . --push --file Dockerfile --tag pymedusa/medusa:develop
run: docker buildx build . --push --platform linux/amd64,linux/arm/v7,linux/arm64 --file Dockerfile --tag pymedusa/medusa:develop
12 changes: 9 additions & 3 deletions .github/workflows/docker-image-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: install buildx
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
uses: docker/setup-buildx-action@v1
with:
version: latest
install: true
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 0.5.23 (11-02-2022)

#### New Features
- Add support for banner and background images to indexer tvmaze ([10234](https://github.com/pymedusa/Medusa/pull/10234))
- Add option for using ffprobe to validate postprocessed media ([10132](https://github.com/pymedusa/Medusa/pull/10132))
- Add change indexer page to change the current indexer for shows in bulk ([9862](https://github.com/pymedusa/Medusa/pull/9862))
- Add search templates feature. ([3732](https://github.com/pymedusa/Medusa/pull/3732))

#### Improvements
- Add column sorting for the add new show page search results ([10217](https://github.com/pymedusa/Medusa/pull/10217))
- Add series start year as a renaming option ([10183](https://github.com/pymedusa/Medusa/pull/10183))
- Remove git username/password authentication. No longer supported by github. ([10144](https://github.com/pymedusa/Medusa/pull/10144))
- Add option to allow for overwriting nfo files. ([10237](https://github.com/pymedusa/Medusa/pull/10237))
- Improve kodi nfo file creation. ([10237](https://github.com/pymedusa/Medusa/pull/10237))
- Add filter options to the manual search results table. ([10252](https://github.com/pymedusa/Medusa/pull/10252))

#### Fixes
- Fix displayShow search subtitle button ([10214](https://github.com/pymedusa/Medusa/pull/10214))
- Prevent failedDownloads from errorring, when a provider has been deleted ([10214](https://github.com/pymedusa/Medusa/pull/10214))
- Fix mass update status page, start a new snatch when changing status to failed. ([10213](https://github.com/pymedusa/Medusa/pull/10213))
- Fix changing process method in manual postprocessing. ([10220](https://github.com/pymedusa/Medusa/pull/10220))
- Fix saving season posters / banners when using tvdb ([10251](https://github.com/pymedusa/Medusa/pull/10251))
- Fix Addic7ed.com subtitle provider ([10312](https://github.com/pymedusa/Medusa/pull/10312))

-----

## 0.5.22 (23-12-2021)

#### Fixes
Expand Down
1 change: 1 addition & 0 deletions lib/pytvmaze/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
show_seasons = 'http://api.tvmaze.com/shows/{0}/seasons'
season_by_id = 'http://api.tvmaze.com/seasons/{0}'
episode_by_id = 'http://api.tvmaze.com/episodes/{0}'
show_images = 'http://api.tvmaze.com/shows/{0}/images'

# TVMaze Premium endpoints
followed_shows = 'http://api.tvmaze.com/v1/user/follows/shows{0}'
Expand Down
3 changes: 3 additions & 0 deletions lib/pytvmaze/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class SeasonNotFound(BaseError):
pass


class ImagesNotFound(BaseError):
pass

class IllegalAirDate(BaseError):
pass

Expand Down
23 changes: 23 additions & 0 deletions lib/pytvmaze/tvmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,21 @@ def __repr__(self):
))


class Image(object):
def __init__(self, data):
self.id = data.get('id')
self.type = data.get('type')
self.main = data.get('main')
self.resolutions = data.get('resolutions')

def __repr__(self):
return '<Image(maze_id={id},type={type},main={main})>'.format(
id=self.id,
type=self.type,
main=self.main
)


class Updates(object):
def __init__(self, data):
self.updates = dict()
Expand Down Expand Up @@ -1199,6 +1214,14 @@ def show_seasons(self, maze_id):
else:
raise SeasonNotFound('Couldn\'t find Season\'s for TVMaze ID {0}'.format(maze_id))

def show_images(self, maze_id):
url = endpoints.show_images.format(maze_id)
q = self._endpoint_standard_get(url)
if q:
return [Image(image) for image in q]
else:
raise ImagesNotFound('Couldn\'t find Images\'s for TVMaze ID {0}'.format(maze_id))

def season_by_id(self, season_id):
url = endpoints.season_by_id.format(season_id)
q = self._endpoint_standard_get(url)
Expand Down
32 changes: 18 additions & 14 deletions medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,6 @@ def initialize(self, console_logging=True):
app.ENCRYPTION_SECRET = check_setting_str(app.CFG, 'General', 'encryption_secret', helpers.generate_cookie_secret(), censor_log='low')

# git login info
app.GIT_AUTH_TYPE = check_setting_int(app.CFG, 'General', 'git_auth_type', 0)
app.GIT_USERNAME = check_setting_str(app.CFG, 'General', 'git_username', '')
app.GIT_PASSWORD = check_setting_str(app.CFG, 'General', 'git_password', '', censor_log='low')
app.GIT_TOKEN = check_setting_str(app.CFG, 'General', 'git_token', '', censor_log='low', encrypted=True)
app.DEVELOPER = bool(check_setting_int(app.CFG, 'General', 'developer', 0))
app.PYTHON_VERSION = check_setting_list(app.CFG, 'General', 'python_version', [], transform=int)
Expand Down Expand Up @@ -579,7 +576,7 @@ def initialize(self, console_logging=True):
app.DOWNLOAD_URL = check_setting_str(app.CFG, 'General', 'download_url', '')
app.LOCALHOST_IP = check_setting_str(app.CFG, 'General', 'localhost_ip', '')
app.CPU_PRESET = check_setting_str(app.CFG, 'General', 'cpu_preset', 'NORMAL')
app.ANON_REDIRECT = check_setting_str(app.CFG, 'General', 'anon_redirect', 'http://dereferer.org/?')
app.ANON_REDIRECT = check_setting_str(app.CFG, 'General', 'anon_redirect', 'https://anonym.to/?')
app.PROXY_SETTING = check_setting_str(app.CFG, 'General', 'proxy_setting', '')
app.PROXY_PROVIDERS = bool(check_setting_int(app.CFG, 'General', 'proxy_providers', 1))
app.PROXY_INDEXERS = bool(check_setting_int(app.CFG, 'General', 'proxy_indexers', 1))
Expand Down Expand Up @@ -694,6 +691,9 @@ def initialize(self, console_logging=True):
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))

app.FFMPEG_CHECK_STREAMS = bool(check_setting_int(app.CFG, 'ffmpeg', 'ffmpeg_check_streams', 0))
app.FFMPEG_PATH = check_setting_str(app.CFG, 'ffmpeg', 'ffmpeg_path', '')

app.PROWLARR_URL = check_setting_str(app.CFG, 'Prowlarr', 'url', '', censor_log='normal')
app.PROWLARR_APIKEY = check_setting_str(app.CFG, 'Prowlarr', 'apikey', '', censor_log='high')

Expand Down Expand Up @@ -879,6 +879,8 @@ def initialize(self, console_logging=True):
app.TRAKT_REMOVE_SHOW_FROM_APPLICATION = bool(check_setting_int(app.CFG, 'Trakt', 'trakt_remove_show_from_application', 0))

app.TRAKT_SYNC_WATCHLIST = bool(check_setting_int(app.CFG, 'Trakt', 'trakt_sync_watchlist', 0))
app.TRAKT_SYNC_TO_WATCHLIST = bool(check_setting_int(app.CFG, 'Trakt', 'trakt_sync_to_watchlist', 1))

app.TRAKT_METHOD_ADD = check_setting_int(app.CFG, 'Trakt', 'trakt_method_add', 0)
app.TRAKT_START_PAUSED = bool(check_setting_int(app.CFG, 'Trakt', 'trakt_start_paused', 0))
app.TRAKT_USE_RECOMMENDED = bool(check_setting_int(app.CFG, 'Trakt', 'trakt_use_recommended', 0))
Expand Down Expand Up @@ -999,13 +1001,13 @@ def initialize(self, console_logging=True):
app.AUTO_ANIME_TO_LIST = bool(check_setting_int(app.CFG, 'ANIME', 'auto_anime_to_list', 0))
app.SHOWLISTS_DEFAULT_ANIME = check_setting_list(app.CFG, 'ANIME', 'showlist_default_anime', [])

app.METADATA_KODI = check_setting_list(app.CFG, 'General', 'metadata_kodi', ['0'] * 10, transform=int)
app.METADATA_KODI_12PLUS = check_setting_list(app.CFG, 'General', 'metadata_kodi_12plus', ['0'] * 10, transform=int)
app.METADATA_MEDIABROWSER = check_setting_list(app.CFG, 'General', 'metadata_mediabrowser', ['0'] * 10, transform=int)
app.METADATA_PS3 = check_setting_list(app.CFG, 'General', 'metadata_ps3', ['0'] * 10, transform=int)
app.METADATA_WDTV = check_setting_list(app.CFG, 'General', 'metadata_wdtv', ['0'] * 10, transform=int)
app.METADATA_TIVO = check_setting_list(app.CFG, 'General', 'metadata_tivo', ['0'] * 10, transform=int)
app.METADATA_MEDE8ER = check_setting_list(app.CFG, 'General', 'metadata_mede8er', ['0'] * 10, transform=int)
app.METADATA_KODI = check_setting_list(app.CFG, 'General', 'metadata_kodi', ['0'] * 11, transform=int)
app.METADATA_KODI_12PLUS = check_setting_list(app.CFG, 'General', 'metadata_kodi_12plus', ['0'] * 11, transform=int)
app.METADATA_MEDIABROWSER = check_setting_list(app.CFG, 'General', 'metadata_mediabrowser', ['0'] * 11, transform=int)
app.METADATA_PS3 = check_setting_list(app.CFG, 'General', 'metadata_ps3', ['0'] * 11, transform=int)
app.METADATA_WDTV = check_setting_list(app.CFG, 'General', 'metadata_wdtv', ['0'] * 11, transform=int)
app.METADATA_TIVO = check_setting_list(app.CFG, 'General', 'metadata_tivo', ['0'] * 11, transform=int)
app.METADATA_MEDE8ER = check_setting_list(app.CFG, 'General', 'metadata_mede8er', ['0'] * 11, transform=int)

app.HOME_LAYOUT = check_setting_str(app.CFG, 'GUI', 'home_layout', 'poster')
app.HISTORY_LAYOUT = check_setting_str(app.CFG, 'GUI', 'history_layout', 'detailed')
Expand Down Expand Up @@ -1570,9 +1572,6 @@ def save_config():
# For passwords you must include the word `password` in the item_name
# and add `helpers.encrypt(ITEM_NAME, ENCRYPTION_VERSION)` in save_config()
new_config['General'] = {}
new_config['General']['git_auth_type'] = app.GIT_AUTH_TYPE
new_config['General']['git_username'] = app.GIT_USERNAME
new_config['General']['git_password'] = helpers.encrypt(app.GIT_PASSWORD, app.ENCRYPTION_VERSION)
new_config['General']['git_token'] = helpers.encrypt(app.GIT_TOKEN, app.ENCRYPTION_VERSION)
new_config['General']['git_reset'] = int(app.GIT_RESET)
new_config['General']['git_reset_branches'] = app.GIT_RESET_BRANCHES
Expand Down Expand Up @@ -1737,6 +1736,10 @@ def save_config():
new_config['General']['fallback_plex_notifications'] = app.FALLBACK_PLEX_NOTIFICATIONS
new_config['General']['fallback_plex_timeout'] = app.FALLBACK_PLEX_TIMEOUT

new_config['ffmpeg'] = {}
new_config['ffmpeg']['ffmpeg_check_streams'] = app.FFMPEG_CHECK_STREAMS
new_config['ffmpeg']['ffmpeg_path'] = app.FFMPEG_PATH

new_config['Recommended'] = {}
new_config['Recommended']['cache_shows'] = app.CACHE_RECOMMENDED_SHOWS
new_config['Recommended']['cache_trakt'] = app.CACHE_RECOMMENDED_TRAKT
Expand Down Expand Up @@ -1988,6 +1991,7 @@ def save_config():
new_config['Trakt']['trakt_remove_serieslist'] = int(app.TRAKT_REMOVE_SERIESLIST)
new_config['Trakt']['trakt_remove_show_from_application'] = int(app.TRAKT_REMOVE_SHOW_FROM_APPLICATION)
new_config['Trakt']['trakt_sync_watchlist'] = int(app.TRAKT_SYNC_WATCHLIST)
new_config['Trakt']['trakt_sync_to_watchlist'] = int(app.TRAKT_SYNC_TO_WATCHLIST)
new_config['Trakt']['trakt_method_add'] = int(app.TRAKT_METHOD_ADD)
new_config['Trakt']['trakt_start_paused'] = int(app.TRAKT_START_PAUSED)
new_config['Trakt']['trakt_use_recommended'] = int(app.TRAKT_USE_RECOMMENDED)
Expand Down
9 changes: 5 additions & 4 deletions medusa/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):
self.CONFIG_FILE = None

# This is the version of the config we EXPECT to find
self.CONFIG_VERSION = 11
self.CONFIG_VERSION = 12

# Default encryption version (0 for None)
self.ENCRYPTION_VERSION = 0
Expand Down Expand Up @@ -139,9 +139,6 @@ def __init__(self):
self.GIT_REMOTE = ''
self.GIT_REMOTE_URL = ''
self.CUR_COMMIT_BRANCH = ''
self.GIT_AUTH_TYPE = 0
self.GIT_USERNAME = None
self.GIT_PASSWORD = None
self.GIT_TOKEN = None
self._GIT_PATH = ''
self.DEVELOPER = False
Expand Down Expand Up @@ -326,6 +323,9 @@ def __init__(self):
self.SKIP_REMOVED_FILES = False
self.ALLOWED_EXTENSIONS = ['srt', 'nfo', 'sub', 'idx']

self.FFMPEG_CHECK_STREAMS = False
self.FFMPEG_PATH = ''

self.NZBS = False
self.NZBS_UID = None
self.NZBS_HASH = None
Expand Down Expand Up @@ -515,6 +515,7 @@ def __init__(self):
self.TRAKT_REMOVE_SERIESLIST = False
self.TRAKT_REMOVE_SHOW_FROM_APPLICATION = False
self.TRAKT_SYNC_WATCHLIST = False
self.TRAKT_SYNC_TO_WATCHLIST = False
self.TRAKT_METHOD_ADD = None
self.TRAKT_START_PAUSED = False
self.TRAKT_USE_RECOMMENDED = False
Expand Down
3 changes: 2 additions & 1 deletion medusa/clients/torrent/deluge.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ def get_status(self, info_hash):
client_status.progress = int(torrent['progress'])

# Store destination
client_status.destination = torrent['download_location']
if torrent.get('download_location'):
client_status.destination = torrent['download_location']

# Store resource
client_status.resource = torrent['name']
Expand Down
5 changes: 3 additions & 2 deletions medusa/clients/torrent/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import logging
import os
from os.path import basename

from medusa import app
from medusa.clients.torrent.generic import GenericClient
Expand Down Expand Up @@ -416,10 +417,10 @@ def get_status(self, info_hash):
client_status.destination = torrent['save_path']

# Store resource
client_status.resource = torrent['name']
client_status.resource = basename(torrent['content_path'])

log.info('Qbittorrent torrent: [{name}] using state: [{state}]', {
'name': torrent['name'], 'state': torrent['state']
'name': client_status.resource, 'state': torrent['state']
})

return client_status
Expand Down
3 changes: 2 additions & 1 deletion medusa/clients/torrent/utorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def _add_torrent_file(self, result):

def _set_torrent_label(self, result):
"""Send a 'setprop' request to uTorrent to set a label for the torrent, optionally - the show name."""
torrent_new_label = result.series.name
# Sanitize the name so that utorrent can create the folder.
torrent_new_label = re.sub("[:'!~?°;$&*#@%]", '', result.series.name)

if result.series.is_anime and app.TORRENT_LABEL_ANIME:
label = app.TORRENT_LABEL_ANIME
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.5.22'
VERSION = '0.5.23'

USER_AGENT = 'Medusa/{version} ({system}; {release}; {instance})'.format(
version=VERSION, system=platform.system(), release=platform.release(),
Expand Down
26 changes: 25 additions & 1 deletion medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,8 @@ def __init__(self, config_obj):
8: 'Convert Plex setting keys',
9: 'Added setting "enable_manualsearch" for providers (dynamic setting)',
10: 'Convert all csv config items to lists',
11: 'Convert provider ratio type string to int'
11: 'Convert provider ratio type string to int',
12: 'Add new metadata option overwrite_nfo'
}

def migrate_config(self):
Expand Down Expand Up @@ -1279,3 +1280,26 @@ def _migrate_v11(self):
provider.ratio = -1
elif isinstance(provider.ratio, str):
provider.ratio = int(provider.ratio)

def _migrate_v12(self):
"""Add new option to metadata providers."""
def add_new_option(metadata_prov):
if len(metadata_prov) == 10:
metadata_prov.append(0)
return metadata_prov

app.METADATA_KODI = check_setting_list(app.CFG, 'General', 'metadata_kodi', ['0'] * 11, transform=int)
app.METADATA_KODI_12PLUS = check_setting_list(app.CFG, 'General', 'metadata_kodi_12plus', ['0'] * 11, transform=int)
app.METADATA_MEDIABROWSER = check_setting_list(app.CFG, 'General', 'metadata_mediabrowser', ['0'] * 11, transform=int)
app.METADATA_PS3 = check_setting_list(app.CFG, 'General', 'metadata_ps3', ['0'] * 11, transform=int)
app.METADATA_WDTV = check_setting_list(app.CFG, 'General', 'metadata_wdtv', ['0'] * 11, transform=int)
app.METADATA_TIVO = check_setting_list(app.CFG, 'General', 'metadata_tivo', ['0'] * 11, transform=int)
app.METADATA_MEDE8ER = check_setting_list(app.CFG, 'General', 'metadata_mede8er', ['0'] * 11, transform=int)

app.METADATA_KODI = add_new_option(app.METADATA_KODI)
app.METADATA_KODI_12PLUS = add_new_option(app.METADATA_KODI_12PLUS)
app.METADATA_MEDIABROWSER = add_new_option(app.METADATA_MEDIABROWSER)
app.METADATA_PS3 = add_new_option(app.METADATA_PS3)
app.METADATA_WDTV = add_new_option(app.METADATA_WDTV)
app.METADATA_TIVO = add_new_option(app.METADATA_TIVO)
app.METADATA_MEDE8ER = add_new_option(app.METADATA_MEDE8ER)
34 changes: 34 additions & 0 deletions medusa/databases/main_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,3 +995,37 @@ def execute(self):
self.addColumn('history', 'part_of_batch', 'INTEGER')

self.inc_minor_version()


class AddSearchTemplates(AddHistoryFDHFields):
"""Create a new table search_templates in main.db."""

def test(self):
"""
Test if the version is at least 44.19
"""
return self.connection.version >= (44, 19)

def execute(self):
utils.backup_database(self.connection.path, self.connection.version)

log.info(u'Creating a new table search_templates in the main.db database.')

self.connection.action(
"""CREATE TABLE "search_templates" (
`search_template_id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`template` TEXT,
`title` TEXT,
`indexer` INTEGER,
`series_id` INTEGER,
`season` INTEGER,
`enabled` INTEGER DEFAULT 1,
`default` INTEGER DEFAULT 1,
`season_search` INTEGER DEFAULT 0);"""
)

log.info(u'Adding new templates field in the tv_shows table')
if not self.hasColumn('tv_shows', 'templates'):
self.addColumn('tv_shows', 'templates', 'NUMERIC', 0)

self.inc_minor_version()
2 changes: 1 addition & 1 deletion medusa/helpers/externals.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_trakt_externals(externals):

try:
result = sync.search_by_id(externals[external_key], id_type=trakt_mapping[external_key], media_type='show')
except TraktException as error:
except (TraktException, RequestException) as error:
log.warning('Error getting external key {external}, error: {error!r}', {
'external': trakt_mapping[external_key], 'error': error
})
Expand Down
Loading

0 comments on commit dd0b950

Please sign in to comment.