Skip to content

Commit

Permalink
Feature/search subs (#10214)
Browse files Browse the repository at this point in the history
* Fix show the search subtitles button

* Prevent failedDownloads from errorring, when a provider has been deleted.

* yarn dev
  • Loading branch information
p0psicles authored Jan 2, 2022
1 parent 4490591 commit dc9675c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
24 changes: 18 additions & 6 deletions medusa/server/api/v2/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,16 +554,28 @@ def resource_get_failed(self):

results = []
for result in sql_results:
provider = providers.get_provider_class(GenericProvider.make_id(result['provider']))
provider = {}
provider_id = GenericProvider.make_id(result['provider'])
provider_class = providers.get_provider_class(provider_id)

if provider_class:
provider.update({
'id': provider_class.get_id(),
'name': provider_class.name,
'imageName': provider_class.image_name()
})
else:
provider.update({
'id': provider_id,
'name': result['provider'],
'imageName': f'{provider_id}.png'
})

results.append({
'id': result['id'],
'release': result['release'],
'size': result['size'],
'provider': {
'id': provider.get_id(),
'name': provider.name,
'imageName': provider.image_name()
}
'provider': provider
})

return self._ok(data=results)
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/router/sub-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const showSubMenu = vm => {
{
title: 'Download Subtitles',
path: `home/subtitleShow?showslug=${showSlug}`,
requires: config.general.subtitles.enabled && !isBeingSubtitled && show.config.subtitlesEnabled,
requires: config.subtitles.enabled && !isBeingSubtitled && show.config.subtitlesEnabled,
icon: 'menu-icon-backlog'
}
]);
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/medusa-runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc9675c

Please sign in to comment.