Skip to content

[change] emby: Manage all media types in lists#3253

Merged
gazpachoking merged 5 commits intoFlexget:developfrom
soloam:emby_list_all_media_types
Nov 23, 2021
Merged

[change] emby: Manage all media types in lists#3253
gazpachoking merged 5 commits intoFlexget:developfrom
soloam:emby_list_all_media_types

Conversation

@soloam
Copy link
Copy Markdown
Contributor

@soloam soloam commented Nov 23, 2021

Motivation for changes:

Allow the managing of lists and favorites with all media types

Detailed changes:

  • Added matching of config types to the emby api types

Addressed issues:

@soloam soloam mentioned this pull request Nov 23, 2021
1 task
Comment on lines +557 to +569
args['IncludeItemTypes'] = []
for mtyp in self.types:
mtyp = str(mtyp).lower
if mtyp in ['movie', 'movies']:
args['IncludeItemTypes'].append('Movie')
elif mtyp in ['serie', 'series']:
args['IncludeItemTypes'].append('Series')
elif mtyp in ['season', 'seasons']:
args['IncludeItemTypes'].append('Season')
elif mtyp in ['episode', 'episode']:
args['IncludeItemTypes'].append('Episode')

args['IncludeItemTypes'] = ','.join(self.types)
Copy link
Copy Markdown
Member

@gazpachoking gazpachoking Nov 23, 2021

Choose a reason for hiding this comment

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

Doesn't seem like we need to support with and without the 's'. Why not just make there be one right way. (When the user is entering it in the config, it's already enforced due to the config validator.)

Suggested change
args['IncludeItemTypes'] = []
for mtyp in self.types:
mtyp = str(mtyp).lower
if mtyp in ['movie', 'movies']:
args['IncludeItemTypes'].append('Movie')
elif mtyp in ['serie', 'series']:
args['IncludeItemTypes'].append('Series')
elif mtyp in ['season', 'seasons']:
args['IncludeItemTypes'].append('Season')
elif mtyp in ['episode', 'episode']:
args['IncludeItemTypes'].append('Episode')
args['IncludeItemTypes'] = ','.join(self.types)
args['IncludeItemTypes'] = ','.join(typ.title() for typ in self.types)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done! I din't knew about that "title()" method :)

@gazpachoking gazpachoking merged commit fcd16ff into Flexget:develop Nov 23, 2021
@gazpachoking
Copy link
Copy Markdown
Member

Thanks!

@soloam soloam deleted the emby_list_all_media_types branch December 23, 2021 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

from_emby not working with series, always returns movies

2 participants