Explorar o código

ref: archive unfinished feature

Sv443 hai 10 meses
pai
achega
b70a366cdc
Modificáronse 7 ficheiros con 33 adicións e 47 borrados
  1. 16 23
      assets/translations/README.md
  2. 0 1
      assets/translations/en_US.json
  3. 3 3
      src/config.ts
  4. 12 11
      src/features/index.ts
  5. 1 6
      src/features/layout.ts
  6. 1 1
      src/index.ts
  7. 0 2
      src/types.ts

+ 16 - 23
assets/translations/README.md

@@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 ### Translation progress:
 |   | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
-| ─ | [`en_US`](./en_US.json) | 263 (default locale) |  |
-| ‼️ | [`de_DE`](./de_DE.json) | `210/263` (79.8%) | ─ |
-| ─ | [`en_UK`](./en_UK.json) | `263` (100%) | `en_US` |
-| ‼️ | [`es_ES`](./es_ES.json) | `210/263` (79.8%) | ─ |
-| ‼️ | [`fr_FR`](./fr_FR.json) | `210/263` (79.8%) | ─ |
-| ‼️ | [`hi_IN`](./hi_IN.json) | `210/263` (79.8%) | ─ |
-| ‼️ | [`ja_JA`](./ja_JA.json) | `210/263` (79.8%) | ─ |
-| ‼️ | [`pt_BR`](./pt_BR.json) | `210/263` (79.8%) | ─ |
-| ‼️ | [`zh_CN`](./zh_CN.json) | `210/263` (79.8%) | ─ |
+| ─ | [`en_US`](./en_US.json) | 262 (default locale) |  |
+| ‼️ | [`de_DE`](./de_DE.json) | `210/262` (80.2%) | ─ |
+| ─ | [`en_UK`](./en_UK.json) | `262` (100%) | `en_US` |
+| ‼️ | [`es_ES`](./es_ES.json) | `210/262` (80.2%) | ─ |
+| ‼️ | [`fr_FR`](./fr_FR.json) | `210/262` (80.2%) | ─ |
+| ‼️ | [`hi_IN`](./hi_IN.json) | `210/262` (80.2%) | ─ |
+| ‼️ | [`ja_JA`](./ja_JA.json) | `210/262` (80.2%) | ─ |
+| ‼️ | [`pt_BR`](./pt_BR.json) | `210/262` (80.2%) | ─ |
+| ‼️ | [`zh_CN`](./zh_CN.json) | `210/262` (80.2%) | ─ |
 
 <sub>
 ✅ - Fully translated
@@ -45,7 +45,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 ### Missing keys:
 
-<details><summary><code>de_DE</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>de_DE</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -82,7 +82,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -105,7 +104,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>es_ES</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>es_ES</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -142,7 +141,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -165,7 +163,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>fr_FR</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>fr_FR</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -202,7 +200,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -225,7 +222,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>hi_IN</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>hi_IN</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -262,7 +259,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -285,7 +281,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>ja_JA</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>ja_JA</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -322,7 +318,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -345,7 +340,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>pt_BR</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>pt_BR</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -382,7 +377,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |
@@ -405,7 +399,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <br></details>
 
-<details><summary><code>zh_CN</code> - 53 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>zh_CN</code> - 52 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -442,7 +436,6 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_desc_showVotes` | `Show the amount of likes and dislikes on the currently playing song` |
 | `feature_helptext_showVotes` | `This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.` |
 | `feature_desc_showVotesFormat` | `How should the likes and dislikes be formatted?` |
-| `feature_desc_showVoteRatio` | `TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song` |
 | `feature_desc_deleteFromQueueButton` | `Add a button to each song in a list to quickly remove it` |
 | `feature_desc_listButtonsPlacement` | `Where should the list buttons show up?` |
 | `feature_desc_autoLikeChannels` | `Automatically like all songs and videos of certain channels` |

+ 0 - 1
assets/translations/en_US.json

@@ -208,7 +208,6 @@
     "feature_desc_showVotes": "Show the amount of likes and dislikes on the currently playing song",
     "feature_helptext_showVotes": "This feature is powered by Return YouTube Dislike and will show the approximate amount of likes and dislikes on the currently playing song.",
     "feature_desc_showVotesFormat": "How should the likes and dislikes be formatted?",
-    "feature_desc_showVoteRatio": "TODO: Show a colored bar that represents the ratio of likes and dislikes of the currently playing song",
 
     "feature_desc_lyricsQueueButton": "Add a button to each song in a queue to quickly open its lyrics page",
     "feature_desc_deleteFromQueueButton": "Add a button to each song in a list to quickly remove it",

+ 3 - 3
src/config.ts

@@ -76,9 +76,9 @@ export const migrations: DataMigrationsDict = {
         "autoLikeChannels", "autoLikeChannelToggleBtn",
         "autoLikeTimeout", "autoLikeShowToast",
         "autoLikeOpenMgmtDialog", "showVotes",
-        "showVotesFormat", "showVoteRatio",
-        "toastDuration", "initTimeout",
-        // forgot to add this to the migration when adding the feature so now will have to do:
+        "showVotesFormat", "toastDuration",
+        "initTimeout",
+        // forgot to add this to the migration when adding the feature way before so now will have to do:
         "volumeSliderLabel",
       ]), [
         { key: "rememberSongTimeSites", oldDefault: "ytm" },

+ 12 - 11
src/features/index.ts

@@ -244,17 +244,18 @@ export const featInfo = {
     reloadRequired: false,
     enable: noop,
   },
-  showVoteRatio: {
-    type: "select",
-    category: "layout",
-    options: () => [
-      { value: "disabled", label: t("vote_ratio_disabled") },
-      { value: "greenRed", label: t("vote_ratio_green_red") },
-      { value: "blueGray", label: t("vote_ratio_blue_gray") },
-    ],
-    default: "disabled",
-    textAdornment: adornments.reloadRequired,
-  },
+  // archived idea for future version:
+  // showVoteRatio: {
+  //   type: "select",
+  //   category: "layout",
+  //   options: () => [
+  //     { value: "disabled", label: t("vote_ratio_disabled") },
+  //     { value: "greenRed", label: t("vote_ratio_green_red") },
+  //     { value: "blueGray", label: t("vote_ratio_blue_gray") },
+  //   ],
+  //   default: "disabled",
+  //   textAdornment: adornments.reloadRequired,
+  // },
 
   //#region volume
   volumeSliderLabel: {

+ 1 - 6
src/features/layout.ts

@@ -2,7 +2,7 @@ import { addParent, autoPlural, debounce, fetchAdvanced, pauseFor } from "@sv443
 import { getFeature, getFeatures } from "../config.js";
 import { siteEvents } from "../siteEvents.js";
 import { addSelectorListener } from "../observers.js";
-import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, addStyle, currentMediaType, domLoaded, waitVideoElementReady, getVideoTime, fetchCss, addStyleFromResource, fetchVideoVotes, getWatchId, type VideoVotesObj, dbg } from "../utils/index.js";
+import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, addStyle, currentMediaType, domLoaded, waitVideoElementReady, getVideoTime, fetchCss, addStyleFromResource, fetchVideoVotes, getWatchId, type VideoVotesObj } from "../utils/index.js";
 import { mode, scriptInfo } from "../constants.js";
 import { openCfgMenu } from "../menu/menu_old.js";
 import { createCircularBtn, createRipple } from "../components/index.js";
@@ -729,7 +729,6 @@ export async function initShowVotes() {
           return error("Couldn't fetch votes from ReturnYouTubeDislikes API");
 
         getFeature("showVotes") && addVoteNumbers(voteCont, voteObj);
-        getFeature("showVoteRatio") && addVoteRatio(voteCont, voteObj);
       }
       catch(err) {
         error("Couldn't initialize show votes feature due to an error:", err);
@@ -807,7 +806,3 @@ function formatVoteNumber(num: number) {
       },
   );
 }
-
-function addVoteRatio(voteCont: HTMLElement, voteObj: VideoVotesObj) {
-  dbg("># TODO: addVoteRatio", voteCont, voteObj);
-}

+ 1 - 1
src/index.ts

@@ -162,7 +162,7 @@ async function onDomLoad() {
       if(feats.fixHdrIssues)
         ftInit.push(["fixHdrIssues", fixHdrIssues()]);
 
-      if(feats.showVotes || feats.showVoteRatio !== "disabled")
+      if(feats.showVotes)
         ftInit.push(["showVotes", initShowVotes()]);
 
       //#region (ytm) volume

+ 0 - 2
src/types.ts

@@ -381,8 +381,6 @@ export interface FeatureConfig {
   showVotes: boolean;
   /** Which format to use for the like/dislike ratio on the currently playing song */
   showVotesFormat: "short" | "full";
-  /** Whether to show a bar graph of the like/dislike ratio on the currently playing song and which design it should use */
-  showVoteRatio: "disabled" | "greenRed" | "blueGray";
 
   //#region volume
   /** Add a percentage label to the volume slider */