Skip to content

Commit

Permalink
Use snake case consistently for watch later
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Jan 1, 2024
1 parent 996e282 commit 2787809
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions resources/lib/youtube_plugin/kodion/items/menu_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def delete_playlist(context, playlist_id, playlist_name):
)


def remove_as_watchlater(context, playlist_id, playlist_name):
def remove_as_watch_later(context, playlist_id, playlist_name):
return (
context.localize('watch_later.list.remove'),
'RunPlugin({0})'.format(context.create_uri(
('playlist', 'remove', 'watchlater',),
('playlist', 'remove', 'watch_later',),
{
'playlist_id': playlist_id,
'playlist_name': playlist_name
Expand All @@ -174,11 +174,11 @@ def remove_as_watchlater(context, playlist_id, playlist_name):
)


def set_as_watchlater(context, playlist_id, playlist_name):
def set_as_watch_later(context, playlist_id, playlist_name):
return (
context.localize('watch_later.list.set'),
'RunPlugin({0})'.format(context.create_uri(
('playlist', 'set', 'watchlater',),
('playlist', 'set', 'watch_later',),
{
'playlist_id': playlist_id,
'playlist_name': playlist_name
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/youtube_plugin/youtube/helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ def update_playlist_infos(provider, context, playlist_id_dict,
context, playlist_id, title
),
# remove as my custom watch later playlist
menu_items.remove_as_watchlater(
menu_items.remove_as_watch_later(
context, playlist_id, title
) if playlist_id == custom_watch_later_id else
# set as my custom watch later playlist
menu_items.set_as_watchlater(
menu_items.set_as_watch_later(
context, playlist_id, title
),
# remove as custom history playlist
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/youtube_plugin/youtube/helper/yt_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def _process_rename_playlist(provider, context):
context.get_ui().refresh_container()


def _watchlater_playlist_id_change(context, method):
def _watch_later_playlist_id_change(context, method):
playlist_id = context.get_param('playlist_id', '')
if not playlist_id:
raise KodionException('watchlater_list/%s: missing playlist_id' % method)
Expand Down Expand Up @@ -306,8 +306,8 @@ def process(method, category, provider, context):
return _process_select_playlist(provider, context)
if method == 'rename' and category == 'playlist':
return _process_rename_playlist(provider, context)
if method in {'set', 'remove'} and category == 'watchlater':
return _watchlater_playlist_id_change(context, method)
if method in {'set', 'remove'} and category == 'watch_later':
return _watch_later_playlist_id_change(context, method)
if method in {'set', 'remove'} and category == 'history':
return _history_playlist_id_change(context, method)
raise KodionException("Unknown category '%s' or method '%s'" % (category, method))

0 comments on commit 2787809

Please sign in to comment.