Commit 182a6c0a authored by echel0n's avatar echel0n
Browse files

resolved gettext and fstring issues

parent af667d3d
...@@ -315,8 +315,8 @@ class ShowTaskAdd(ShowTask): ...@@ -315,8 +315,8 @@ class ShowTaskAdd(ShowTask):
f"probably the wrong language used to search with") f"probably the wrong language used to search with")
sickrage.app.alerts.error(_("Unable to add show"), sickrage.app.alerts.error(_("Unable to add show"),
_(f"Show in {self.show_dir} has no name on {sickrage.app.series_providers[self.series_provider_id].name}, " f"Show in {self.show_dir} has no name on {sickrage.app.series_providers[self.series_provider_id].name}, "
f"probably the wrong language. Delete .nfo and add manually in the correct language")) f"probably the wrong language. Delete .nfo and add manually in the correct language")
return self._finish_early() return self._finish_early()
......
...@@ -257,10 +257,9 @@ class UpdateManager(object): ...@@ -257,10 +257,9 @@ class UpdateManager(object):
if not self.manual_update: if not self.manual_update:
update_url = f"{sickrage.app.config.general.web_root}/home/update/?pid={sickrage.app.pid}" update_url = f"{sickrage.app.config.general.web_root}/home/update/?pid={sickrage.app.pid}"
message = _( message = f'New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version} &mdash; <a href=\"{update_url}\">Update Now</a>'
f'New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version} &mdash; <a href=\"{update_url}\">Update Now</a>')
else: else:
message = _(f"New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version}, please manually update!") message = f"New SiCKRAGE {self.current_branch} {sickrage.install_type()} update available, version {latest_version}, please manually update!"
sickrage.app.latest_version_string = message sickrage.app.latest_version_string = message
......
...@@ -178,7 +178,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler): ...@@ -178,7 +178,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler):
if not make_dir(series_directory): if not make_dir(series_directory):
sickrage.app.log.warning(f"Unable to create the folder {series_directory}, can't add the show") sickrage.app.log.warning(f"Unable to create the folder {series_directory}, can't add the show")
sickrage.app.alerts.error(_("Unable to add show"), _(f"Unable to create the folder {series_directory}, can't add the show")) sickrage.app.alerts.error(_("Unable to add show"), f"Unable to create the folder {series_directory}, can't add the show")
return self._bad_request(error=f"Unable to create the show folder {series_directory}, can't add the show") return self._bad_request(error=f"Unable to create the show folder {series_directory}, can't add the show")
chmod_as_parent(series_directory) chmod_as_parent(series_directory)
...@@ -207,7 +207,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler): ...@@ -207,7 +207,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler):
scene=is_scene, scene=is_scene,
skip_downloaded=skip_downloaded) skip_downloaded=skip_downloaded)
sickrage.app.alerts.message(_('Adding Show'), _(f'Adding the specified show into {series_directory}')) sickrage.app.alerts.message(_('Adding Show'), f'Adding the specified show into {series_directory}')
return self.json_response({'message': True}) return self.json_response({'message': True})
...@@ -275,7 +275,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler): ...@@ -275,7 +275,7 @@ class ApiV2SeriesHandler(ApiV2BaseHandler):
try: try:
sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, True) sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, True)
except CantRefreshShowException as e: except CantRefreshShowException as e:
errors.append(_(f"Unable to refresh this show: {e}")) errors.append(f"Unable to refresh this show: {e}")
if data.get('language') is not None: if data.get('language') is not None:
series.lang = data['language'] series.lang = data['language']
...@@ -305,20 +305,19 @@ class ApiV2SeriesHandler(ApiV2BaseHandler): ...@@ -305,20 +305,19 @@ class ApiV2SeriesHandler(ApiV2BaseHandler):
try: try:
sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, True) sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, True)
except CantRefreshShowException as e: except CantRefreshShowException as e:
errors.append(_(f"Unable to refresh this show: {e}")) errors.append(f"Unable to refresh this show: {e}")
# grab updated info from TVDB # grab updated info from TVDB
# showObj.loadEpisodesFromSeriesProvider() # showObj.loadEpisodesFromSeriesProvider()
# rescan the episodes in the new folder # rescan the episodes in the new folder
except NoNFOException: except NoNFOException:
warnings.append(_( warnings.append(f"The folder at {data['location']} doesn't contain a tvshow.nfo - copy your files to that folder before you change the directory in SiCKRAGE.")
f"The folder at {data['location']} doesn't contain a tvshow.nfo - copy your files to that folder before you change the directory in SiCKRAGE."))
# force the update # force the update
if do_update: if do_update:
try: try:
sickrage.app.show_queue.update_show(series.series_id, series.series_provider_id, force=True) sickrage.app.show_queue.update_show(series.series_id, series.series_provider_id, force=True)
except CantUpdateShowException as e: except CantUpdateShowException as e:
errors.append(_(f"Unable to update show: {e}")) errors.append(f"Unable to update show: {e}")
if do_update_exceptions: if do_update_exceptions:
try: try:
...@@ -422,7 +421,7 @@ class ApiV2SeriesRefreshHandler(ApiV2BaseHandler): ...@@ -422,7 +421,7 @@ class ApiV2SeriesRefreshHandler(ApiV2BaseHandler):
try: try:
sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, force=bool(force)) sickrage.app.show_queue.refresh_show(series.series_id, series.series_provider_id, force=bool(force))
except CantUpdateShowException as e: except CantUpdateShowException as e:
return self._bad_request(error=_(f"Unable to refresh this show, error: {e}")) return self._bad_request(error=f"Unable to refresh this show, error: {e}")
class ApiV2SeriesUpdateHandler(ApiV2BaseHandler): class ApiV2SeriesUpdateHandler(ApiV2BaseHandler):
...@@ -436,7 +435,7 @@ class ApiV2SeriesUpdateHandler(ApiV2BaseHandler): ...@@ -436,7 +435,7 @@ class ApiV2SeriesUpdateHandler(ApiV2BaseHandler):
try: try:
sickrage.app.show_queue.update_show(series.series_id, series.series_provider_id, force=bool(force)) sickrage.app.show_queue.update_show(series.series_id, series.series_provider_id, force=bool(force))
except CantUpdateShowException as e: except CantUpdateShowException as e:
return self._bad_request(error=_(f"Unable to update this show, error: {e}")) return self._bad_request(error=f"Unable to update this show, error: {e}")
class ApiV2SeriesEpisodesRenameHandler(ApiV2BaseHandler): class ApiV2SeriesEpisodesRenameHandler(ApiV2BaseHandler):
...@@ -627,7 +626,7 @@ class ApiV2SeriesEpisodesManualSearchHandler(ApiV2BaseHandler): ...@@ -627,7 +626,7 @@ class ApiV2SeriesEpisodesManualSearchHandler(ApiV2BaseHandler):
if not all([ep_queue_item.started, ep_queue_item.success]): if not all([ep_queue_item.started, ep_queue_item.success]):
return self.json_response({'success': True}) return self.json_response({'success': True})
return self._not_found(error=_(f"Unable to find season {season_num} episode {episode_num} for show {series.name} on search providers")) return self._not_found(error=f"Unable to find season {season_num} episode {episode_num} for show {series.name} on search providers")
class ApiV2SeriesSearchFormatsHandler(ApiV2BaseHandler): class ApiV2SeriesSearchFormatsHandler(ApiV2BaseHandler):
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment