Ver Fonte

feat: edit auto-like entry & various fixes

Sv443 há 11 meses atrás
pai
commit
a8f40a8cd1

+ 1 - 0
assets/icons/edit.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path fill="#ffffff" d="M200-200h43.92l427.93-427.92-43.93-43.93L200-243.92V-200Zm-40 40v-100.77l527.23-527.77q6.15-5.48 13.57-8.47 7.43-2.99 15.49-2.99t15.62 2.54q7.55 2.54 13.94 9.15l42.69 42.93q6.61 6.38 9.04 14 2.42 7.63 2.42 15.25 0 8.13-2.74 15.56-2.74 7.42-8.72 13.57L260.77-160H160Zm600.77-556.31-44.46-44.46 44.46 44.46ZM649.5-649.5l-21.58-22.35 43.93 43.93-22.35-21.58Z"/></svg>

+ 1 - 0
assets/resources.json

@@ -11,6 +11,7 @@
   "icon-auto_like": "icons/auto_like.svg",
   "icon-clear_list": "icons/clear_list.svg",
   "icon-delete": "icons/delete.svg",
+  "icon-edit": "icons/edit.svg",
   "icon-error": "icons/error.svg",
   "icon-experimental": "icons/beaker_small.svg",
   "icon-globe_small": "icons/globe_small.svg",

+ 79 - 51
assets/translations/README.md

@@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 ### Translation progress:
 | &nbsp; | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
-| ─ | [`en_US`](./en_US.json) | 243 (default locale) |  |
-| ‼️ | [`de_DE`](./de_DE.json) | `213/243` (87.7%) | ─ |
-| ─ | [`en_UK`](./en_UK.json) | `243/243` (100%) | `en_US` |
-| ‼️ | [`es_ES`](./es_ES.json) | `213/243` (87.7%) | ─ |
-| ‼️ | [`fr_FR`](./fr_FR.json) | `213/243` (87.7%) | ─ |
-| ‼️ | [`hi_IN`](./hi_IN.json) | `213/243` (87.7%) | ─ |
-| ‼️ | [`ja_JA`](./ja_JA.json) | `213/243` (87.7%) | ─ |
-| ‼️ | [`pt_BR`](./pt_BR.json) | `213/243` (87.7%) | ─ |
-| ‼️ | [`zh_CN`](./zh_CN.json) | `213/243` (87.7%) | ─ |
+| ─ | [`en_US`](./en_US.json) | 247 (default locale) |  |
+| ‼️ | [`de_DE`](./de_DE.json) | `213/247` (86.2%) | ─ |
+| ─ | [`en_UK`](./en_UK.json) | `247/247` (100%) | `en_US` |
+| ‼️ | [`es_ES`](./es_ES.json) | `213/247` (86.2%) | ─ |
+| ‼️ | [`fr_FR`](./fr_FR.json) | `213/247` (86.2%) | ─ |
+| ‼️ | [`hi_IN`](./hi_IN.json) | `213/247` (86.2%) | ─ |
+| ‼️ | [`ja_JA`](./ja_JA.json) | `213/247` (86.2%) | ─ |
+| ‼️ | [`pt_BR`](./pt_BR.json) | `213/247` (86.2%) | ─ |
+| ‼️ | [`zh_CN`](./zh_CN.json) | `213/247` (86.2%) | ─ |
 
 <sub>
 ✅ - Fully translated
@@ -45,29 +45,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 ### Missing keys:
 
-<details><summary><code>de_DE</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>de_DE</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -82,29 +86,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>es_ES</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>es_ES</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -119,29 +127,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>fr_FR</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>fr_FR</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -156,29 +168,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>hi_IN</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>hi_IN</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -193,29 +209,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>ja_JA</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>ja_JA</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -230,29 +250,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>pt_BR</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>pt_BR</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
@@ -267,29 +291,33 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>zh_CN</code> - 30 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>zh_CN</code> - 34 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
 | `create_new_entry` | `Create a new entry` |
 | `remove_entry` | `Remove this entry` |
-| `auto_like_channels_dialog_title` | `Manage auto-liked channels` |
-| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.` |
+| `edit_entry` | `Edit this entry` |
+| `auto_like_channels_dialog_title` | `Auto-liked channels` |
+| `auto_like_channels_dialog_desc` | `Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.` |
 | `auto_like` | `Auto-like` |
 | `auto_like_button_tooltip_enabled` | `Click to disable auto-liking. Shift-click to open the management dialog.` |
 | `auto_like_button_tooltip_disabled` | `Click to enable auto-liking. Shift-click to open the management dialog.` |
-| `add_auto_like_channel_id_prompt` | `Enter the channel ID or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
-| `add_auto_like_channel_invalid_id` | `The entered channel ID is invalid.\nPlease make sure you copy only the part *after* "/channel/" in the URL, excluding the slash.` |
+| `add_auto_like_channel_id_prompt` | `Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress "cancel" to exit.` |
+| `add_auto_like_channel_invalid_id` | `The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* "/channel/" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.` |
 | `add_auto_like_channel_already_exists_prompt_new_name` | `A channel with that ID is already in the list.\nDo you instead want to change its name?` |
 | `add_auto_like_channel_name_prompt` | `Enter the name of the channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_name_prompt` | `Enter the new name for this channel.\nPress "cancel" to exit.` |
+| `auto_like_channel_edit_id_prompt` | `Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress "cancel" to exit.` |
 | `auto_like_enabled_toast` | `Auto-liking enabled` |
 | `auto_like_disabled_toast` | `Auto-liking disabled` |
-| `auto_liked_video` | `Auto-liked the video` |
+| `auto_liked_channel` | `Auto-liked %1` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
 | `feature_helpText_autoLikeChannels` | `Once enabled, you can enable this feature for certain channels by opening their page and clicking the toggle button. Afterwards, any song you play of that channel will be liked automatically.\nUse the option below to open a dialog to manage the channels.` |
 | `feature_desc_autoLikeChannelToggleBtn` | `Add a button to each channel page to enable or disable auto-liking` |
 | `feature_desc_autoLikePlayerBarToggleBtn` | `Add a button to the media controls to enable or disable auto-liking` |
 | `feature_desc_autoLikeTimeout` | `How many seconds a song needs to play before being liked` |
+| `feature_desc_autoLikeShowToast` | `Show a toast notification when a song is auto-liked` |
 | `feature_desc_autoLikeOpenMgmtDialog` | `Open the dialog to manage auto-liked channels` |
 | `feature_btn_autoLikeOpenMgmtDialog` | `Open dialog` |
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |

+ 9 - 5
assets/translations/en_US.json

@@ -48,6 +48,7 @@
     "trigger_btn_action_running": "Running...",
     "create_new_entry": "Create a new entry",
     "remove_entry": "Remove this entry",
+    "edit_entry": "Edit this entry",
     "remove_from_queue": "Remove this song from the queue",
     "delete_from_list": "Delete this song from the list",
     "couldnt_remove_from_queue": "Couldn't remove this song from the queue",
@@ -129,18 +130,20 @@
     "thumbnail_overlay_image_fit_full": "Show full image",
     "thumbnail_overlay_image_fit_stretch": "Stretch to fit",
 
-    "auto_like_channels_dialog_title": "Manage auto-liked channels",
-    "auto_like_channels_dialog_desc": "Here you can see what channels you have set to auto-like and remove them if you want.\nYou can also manually create them, though it's easier to visit their channel page and click the button.",
+    "auto_like_channels_dialog_title": "Auto-liked channels",
+    "auto_like_channels_dialog_desc": "Here you can see what channels you have set to auto-like and you can edit, enable, disable and remove them.\nYou can also manually create entries, though it's easier to just visit the channel page and click the button there.",
     "auto_like": "Auto-like",
     "auto_like_button_tooltip_enabled": "Click to disable auto-liking. Shift-click to open the management dialog.",
     "auto_like_button_tooltip_disabled": "Click to enable auto-liking. Shift-click to open the management dialog.",
-    "add_auto_like_channel_id_prompt": "Enter the channel ID or full URL of the channel you want to auto-like.\nPress \"cancel\" to exit.",
-    "add_auto_like_channel_invalid_id": "The entered channel ID is invalid.\nPlease make sure you copy only the part *after* \"/channel/\" in the URL, excluding the slash.",
+    "add_auto_like_channel_id_prompt": "Enter the user ID (@Name / UC...) or full URL of the channel you want to auto-like.\nPress \"cancel\" to exit.",
+    "add_auto_like_channel_invalid_id": "The entered user ID or URL is invalid.\nPlease make sure you copy only the part *just after* \"/channel/\" in the URL, excluding any slash before and after.\nIf it starts with @, make sure to include that too.",
     "add_auto_like_channel_already_exists_prompt_new_name": "A channel with that ID is already in the list.\nDo you instead want to change its name?",
     "add_auto_like_channel_name_prompt": "Enter the name of the channel.\nPress \"cancel\" to exit.",
+    "auto_like_channel_edit_name_prompt": "Enter the new name for this channel.\nPress \"cancel\" to exit.",
+    "auto_like_channel_edit_id_prompt": "Enter the new user ID (@Name / UC...) or full URL for this channel.\nPress \"cancel\" to exit.",
     "auto_like_enabled_toast": "Auto-liking enabled",
     "auto_like_disabled_toast": "Auto-liking disabled",
-    "auto_liked_video": "Auto-liked the video",
+    "auto_liked_channel": "Auto-liked %1",
 
     "unit_entries-1": "entry",
     "unit_entries-n": "entries",
@@ -221,6 +224,7 @@
     "feature_desc_autoLikeChannelToggleBtn": "Add a button to each channel page to enable or disable auto-liking",
     "feature_desc_autoLikePlayerBarToggleBtn": "Add a button to the media controls to enable or disable auto-liking",
     "feature_desc_autoLikeTimeout": "How many seconds a song needs to play before being liked",
+    "feature_desc_autoLikeShowToast": "Show a toast notification when a song is auto-liked",
     "feature_desc_autoLikeOpenMgmtDialog": "Open the dialog to manage auto-liked channels",
     "feature_btn_autoLikeOpenMgmtDialog": "Open dialog",
     "feature_btn_autoLikeOpenMgmtDialog_running": "Opening...",

+ 59 - 20
src/dialogs/autoLike.ts

@@ -1,5 +1,5 @@
 import { debounce } from "@sv443-network/userutils";
-import { getDomain, onInteraction, t } from "../utils";
+import { getDomain, log, onInteraction, parseChannelIdFromUrl, t } from "../utils";
 import { BytmDialog, createCircularBtn, createToggleInput } from "../components";
 import { autoLikeStore, initAutoLikeStore } from "../features";
 import { siteEvents } from "../siteEvents";
@@ -10,6 +10,7 @@ let autoLikeDialog: BytmDialog | null = null;
 export async function getAutoLikeDialog() {
   if(!autoLikeDialog) {
     await initAutoLikeStore();
+
     autoLikeDialog = new BytmDialog({
       id: "auto-like-channels",
       width: 600,
@@ -22,6 +23,15 @@ export async function getAutoLikeDialog() {
       renderHeader,
       renderBody,
     });
+
+    siteEvents.on("autoLikeChannelsUpdated", async () => {
+      if(autoLikeDialog?.isOpen()) {
+        autoLikeDialog.close();
+        autoLikeDialog.unmount();
+        await autoLikeDialog.open();
+        log("Auto-like channels updated, refreshed dialog");
+      }
+    });
   }
   return autoLikeDialog;
 }
@@ -66,13 +76,7 @@ async function renderBody() {
     if(!idPrompt)
       return;
 
-    const isId = idPrompt.match(/^@?.+$/);
-    const isUrl = idPrompt.match(/^(?:https?:\/\/)?(?:www\.)?(?:music\.)?youtube\.com\/(?:channel\/|@)([a-zA-Z0-9_-]+)/);
-
-    if(isId?.[0]?.startsWith("@"))
-      isId[0] = isId[0].slice(1);
-
-    const id = (isId?.[0] || isUrl?.[1] || "").trim();
+    const id = parseChannelIdFromUrl(idPrompt) ?? (idPrompt.trim().startsWith("@") ? idPrompt.trim() : null);
 
     if(!id || id.length <= 0)
       return alert(t("add_auto_like_channel_invalid_id"));
@@ -135,7 +139,7 @@ async function renderBody() {
     .getData().channels
     .sort((a, b) => a.name.localeCompare(b.name));
 
-  for(const { name, id, enabled } of sortedChannels) {
+  for(const { name: chanName, id: chanId, enabled } of sortedChannels) {
     const rowElem = document.createElement("div");
     rowElem.classList.add("bytm-auto-like-channel-row");
 
@@ -143,48 +147,75 @@ async function renderBody() {
     leftCont.classList.add("bytm-auto-like-channel-row-left-cont");
 
     const nameLabelEl = document.createElement("label");
-    nameLabelEl.ariaLabel = nameLabelEl.title = name;
-    nameLabelEl.htmlFor = `bytm-auto-like-channel-list-toggle-${id}`;
+    nameLabelEl.ariaLabel = nameLabelEl.title = chanName;
+    nameLabelEl.htmlFor = `bytm-auto-like-channel-list-toggle-${chanId}`;
     nameLabelEl.classList.add("bytm-auto-like-channel-name-label");
 
     const nameElem = document.createElement("a");
     nameElem.classList.add("bytm-auto-like-channel-name", "bytm-link");
-    nameElem.ariaLabel = nameElem.textContent = name;
-    // TODO:FIXME: @-channel links are not working
-    nameElem.href = `https://${getDomain() === "yt" ? "" : "music."}youtube.com/channel/${id}`;
+    nameElem.ariaLabel = nameElem.textContent = chanName;
+    nameElem.href = `https://${getDomain() === "ytm" ? "music." : ""}youtube.com/${chanId.startsWith("@") ? chanId : `channel/${chanId}`}`;
     nameElem.target = "_blank";
     nameElem.rel = "noopener noreferrer";
     nameElem.tabIndex = 0;
 
     const idElem = document.createElement("span");
     idElem.classList.add("bytm-auto-like-channel-id");
-    idElem.textContent = idElem.title = id;
+    idElem.textContent = idElem.title = chanId;
 
     nameLabelEl.appendChild(nameElem);
     nameLabelEl.appendChild(idElem);
 
     const toggleElem = await createToggleInput({
-      id: `bytm-auto-like-channel-list-toggle-${id}`,
+      id: `bytm-auto-like-channel-list-toggle-${chanId}`,
       labelPos: "off",
       initialValue: enabled,
-      onChange: (en) => setChannelEnabled(id, en),
+      onChange: (en) => setChannelEnabled(chanId, en),
     });
     toggleElem.classList.add("bytm-auto-like-channel-toggle");
 
+    const btnCont = document.createElement("div");
+    btnCont.classList.add("bytm-auto-like-channel-row-btn-cont");
+
+    const editBtn = await createCircularBtn({
+      resourceName: "icon-edit",
+      title: t("edit_entry"),
+      async onClick() {
+        const newNamePr = prompt(t("auto_like_channel_edit_name_prompt"), chanName)?.trim();
+        if(!newNamePr || newNamePr.length === 0)
+          return;
+        const newName = newNamePr.length > 0 ? newNamePr : chanName;
+
+        const newIdPr = prompt(t("auto_like_channel_edit_id_prompt"), chanId)?.trim();
+        if(!newIdPr || newIdPr.length === 0)
+          return;
+        const newId = newIdPr.length > 0 ? getChannelIdFromPrompt(newIdPr) ?? chanId : chanId;
+
+        await autoLikeStore.setData({
+          channels: autoLikeStore.getData().channels
+            .map((ch) => ch.id === chanId ? { ...ch, name: newName, id: newId } : ch),
+        });
+
+        siteEvents.emit("autoLikeChannelsUpdated");
+      },
+    });
+    btnCont.appendChild(editBtn);
+
     const removeBtn = await createCircularBtn({
       resourceName: "icon-delete",
       title: t("remove_entry"),
-      onClick() {
-        removeChannel(id);
+      async onClick() {
+        await removeChannel(chanId);
         rowElem.remove();
       },
     });
+    btnCont.appendChild(removeBtn);
 
     leftCont.appendChild(toggleElem);
     leftCont.appendChild(nameLabelEl);
 
     rowElem.appendChild(leftCont);
-    rowElem.appendChild(removeBtn);
+    rowElem.appendChild(btnCont);
 
     channelListCont.appendChild(rowElem);
   }
@@ -193,3 +224,11 @@ async function renderBody() {
 
   return contElem;
 }
+
+function getChannelIdFromPrompt(promptStr: string) {
+  const isId = promptStr.match(/^@?.+$/);
+  const isUrl = promptStr.match(/^(?:https?:\/\/)?(?:www\.)?(?:music\.)?youtube\.com\/(?:channel\/|@)([a-zA-Z0-9_-]+)/);
+
+  const id = (isId?.[0] || isUrl?.[1] || "").trim();
+  return id.length > 0 ? id : null;
+}

+ 2 - 1
src/features/index.ts

@@ -227,7 +227,8 @@ export const featInfo = {
     category: "layout",
     options: options.siteSelectionOrNone,
     default: "all",
-    textAdornment: adornments.reloadRequired,
+    advanced: true,
+    textAdornment: () => combineAdornments([adornments.reloadRequired, adornments.advanced]),
   },
 
   //#region volume

+ 24 - 12
src/features/input.ts

@@ -155,8 +155,7 @@ export async function initNumKeysSkip() {
 
 let canCompress = false;
 
-/** DataStore instance for all auto-liked channels */
-export const autoLikeStore = new DataStore<{
+type AutoLikeData = {
   channels: {
     /** 24-character channel ID or user ID including the @ prefix */
     id: string;
@@ -165,15 +164,28 @@ export const autoLikeStore = new DataStore<{
     /** Whether the channel should be auto-liked */
     enabled: boolean;
   }[];
-}>({
+};
+
+/** DataStore instance for all auto-liked channels */
+export const autoLikeStore = new DataStore<AutoLikeData>({
   id: "bytm-auto-like-channels",
-  formatVersion: 1,
+  formatVersion: 2,
   defaultData: {
     channels: [],
   },
   encodeData: (data) => canCompress ? compress(data, compressionFormat, "string") : data,
   decodeData: (data) => canCompress ? decompress(data, compressionFormat, "string") : data,
-  // migrations: {},
+  migrations: {
+    // 1 -> 2 (v2.1-pre) - add @ prefix to channel IDs if missing
+    2: (oldData: AutoLikeData) => ({
+      channels: oldData.channels.map((ch) => ({
+        ...ch,
+        id: ch.id.trim().match(/^(UC|@).+$/)
+          ? ch.id.trim()
+          : `@${ch.id.trim()}`,
+      })),
+    }),
+  },
 });
 
 let autoLikeStoreLoaded = false;
@@ -215,6 +227,10 @@ export async function initAutoLike() {
 
           if(likeRenderer.getAttribute("like-status") !== "LIKE") {
             likeBtn.click();
+            getFeature("autoLikeShowToast") && showIconToast({
+              message: t("auto_liked_channel", likeChan.name),
+              icon: "icon-auto_like",
+            });
             log(`Auto-liked channel '${likeChan.name}' (ID: '${likeChan.id}')`);
           }
         }, (getFeature("autoLikeTimeout") ?? 5) * 1000);
@@ -238,8 +254,6 @@ export async function initAutoLike() {
               }
               else {
                 // some channels don't have a subscribe button and instead only have a "share" button for some bullshit reason
-                // (this is only the case on YTM, on YT the subscribe button exists and works perfectly fine)
-
                 const shareBtnEl = headerCont.querySelector<HTMLElement>("ytmusic-menu-renderer #top-level-buttons yt-button-renderer:last-of-type");
                 const chanName = headerCont.querySelector<HTMLElement>("ytmusic-visual-header-renderer .content-container h2 yt-formatted-string")?.textContent ?? null;
                 shareBtnEl && chanName && addAutoLikeToggleBtn(shareBtnEl, chanId, chanName);
@@ -258,11 +272,9 @@ export async function initAutoLike() {
         timeout = setTimeout(() => {
           addSelectorListener<HTMLAnchorElement, "yt">("watchMetadata", "#owner ytd-channel-name yt-formatted-string a", {
             listener(chanElem) {
-              let chanId = chanElem.href.split("/").pop();
-              if(!chanId?.startsWith("@"))
-                chanId = `@${chanId}`;
+              const chanElemId = chanElem.href.split("/").pop()?.split("/")[0] ?? null;
 
-              const likeChan = autoLikeStore.getData().channels.find((ch) => ch.id === chanId);
+              const likeChan = autoLikeStore.getData().channels.find((ch) => ch.id === chanElemId);
               if(!likeChan || !likeChan.enabled)
                 return;
 
@@ -271,7 +283,7 @@ export async function initAutoLike() {
                   if(likeBtn.getAttribute("aria-pressed") !== "true") {
                     likeBtn.click();
                     getFeature("autoLikeShowToast") && showIconToast({
-                      message: t("auto_liked_video"),
+                      message: t("auto_liked_channel", likeChan.name),
                       icon: "icon-auto_like",
                     });
                     log(`Auto-liked channel '${likeChan.name}' (ID: '${likeChan.id}')`);

+ 1 - 0
src/siteEvents.ts

@@ -64,6 +64,7 @@ export const allSiteEvents = [
   "watchIdChanged",
   "pathChanged",
   "fullscreenToggled",
+  "autoLikeChannelsUpdated",
 ] as const;
 
 /** EventEmitter instance that is used to detect changes to the site */

+ 6 - 1
src/utils/misc.ts

@@ -80,8 +80,13 @@ export function getWatchId() {
  * Returns null if the current page is not a channel page or there was an error parsing the URL
  */
 export function getCurrentChannelId() {
+  return parseChannelIdFromUrl(location.href);
+}
+
+/** Returns the channel ID from a URL or null if the URL is invalid */
+export function parseChannelIdFromUrl(url: string | URL) {
   try {
-    const { pathname } = new URL(location.href);
+    const { pathname } = url instanceof URL ? url : new URL(url);
     if(pathname.includes("/channel/"))
       return pathname.split("/channel/")[1].split("/")[0];
     else if(pathname.includes("/@"))