diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 9f983e2e..00000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-version: 2
-updates:
- # Maintain dependencies for npm
- - package-ecosystem: "npm"
- directory: "/"
- schedule:
- interval: "daily"
- # Maintain dependencies for GitHub Actions
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "daily"
diff --git a/package.json b/package.json
index 06dfcfa2..fee5212b 100644
--- a/package.json
+++ b/package.json
@@ -9,42 +9,41 @@
"lint": "eslint --fix --color --ignore-path .gitignore --ext .js,.vue ."
},
"dependencies": {
- "@fortawesome/fontawesome-svg-core": "^6.2.0",
- "@fortawesome/free-brands-svg-icons": "^6.2.0",
- "@fortawesome/free-solid-svg-icons": "^6.2.0",
- "@fortawesome/vue-fontawesome": "^3.0.1",
- "buffer": "^6.0.3",
- "dompurify": "^2.4.0",
- "hotkeys-js": "^3.10.0",
- "javascript-time-ago": "^2.5.7",
- "mux.js": "^6.2.0",
- "shaka-player": "4.2.2",
- "stream": "^0.0.2",
- "vue": "^3.2.41",
- "vue-i18n": "^9.2.2",
- "vue-router": "^4.1.5",
- "xml-js": "^1.6.11"
+ "@fortawesome/fontawesome-svg-core": "6.2.0",
+ "@fortawesome/free-brands-svg-icons": "6.2.0",
+ "@fortawesome/free-solid-svg-icons": "6.2.0",
+ "@fortawesome/vue-fontawesome": "3.0.2",
+ "buffer": "6.0.3",
+ "dompurify": "2.4.0",
+ "hotkeys-js": "3.10.0",
+ "javascript-time-ago": "2.5.9",
+ "mux.js": "6.2.0",
+ "shaka-player": "4.2.3",
+ "stream-browserify": "3.0.0",
+ "vue": "3.2.43",
+ "vue-i18n": "9.2.2",
+ "vue-router": "4.1.6",
+ "xml-js": "1.6.11"
},
"devDependencies": {
- "@iconify/json": "^2.1.122",
- "@intlify/vite-plugin-vue-i18n": "^6.0.3",
- "@unocss/preset-icons": "^0.45.25",
- "@unocss/preset-web-fonts": "^0.45.25",
- "@unocss/transformer-directives": "^0.45.26",
- "@unocss/transformer-variant-group": "^0.45.25",
- "@vitejs/plugin-legacy": "^1.8.2",
- "@vitejs/plugin-vue": "^2.3.4",
- "@vue/compiler-sfc": "3.2.41",
- "babel-eslint": "^10.1.0",
- "eslint": "^7.32.0",
- "eslint-config-prettier": "^8.5.0",
- "eslint-plugin-prettier": "^4.2.1",
- "eslint-plugin-vue": "^9.6.0",
- "prettier": "^2.7.1",
- "unocss": "^0.45.29",
- "vite": "^2.9.14",
- "vite-plugin-eslint": "^1.8.1",
- "vite-plugin-pwa": "^0.12.8"
+ "@iconify/json": "2.1.135",
+ "@intlify/vite-plugin-vue-i18n": "6.0.3",
+ "@unocss/preset-icons": "0.46.4",
+ "@unocss/preset-web-fonts": "0.46.4",
+ "@unocss/transformer-directives": "0.46.4",
+ "@unocss/transformer-variant-group": "0.46.4",
+ "@vitejs/plugin-legacy": "2.3.1",
+ "@vitejs/plugin-vue": "3.2.0",
+ "@vue/compiler-sfc": "3.2.43",
+ "eslint": "8.27.0",
+ "eslint-config-prettier": "8.5.0",
+ "eslint-plugin-prettier": "4.2.1",
+ "eslint-plugin-vue": "9.7.0",
+ "prettier": "2.7.1",
+ "unocss": "0.46.4",
+ "vite": "3.2.3",
+ "vite-plugin-eslint": "1.8.1",
+ "vite-plugin-pwa": "0.13.3"
},
"eslintConfig": {
"root": true,
@@ -56,9 +55,6 @@
"plugin:prettier/recommended",
"eslint:recommended"
],
- "parserOptions": {
- "parser": "babel-eslint"
- },
"rules": {}
},
"browserslist": [
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 00000000..05722b80
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:base",
+ "group:recommended"
+ ],
+ "ignorePresets": [
+ ":prHourlyLimit2"
+ ],
+ "packageRules": [
+ {
+ "matchPackagePrefixes": [
+ "@unocss/"
+ ],
+ "matchPackageNames": [
+ "unocss"
+ ],
+ "groupName": "unocss"
+ }
+ ]
+}
diff --git a/src/App.vue b/src/App.vue
index 8346bd15..fcfd52b3 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -42,8 +42,8 @@ export default {
});
if (this.getPreferenceBoolean("watchHistory", false) || this.getPreferenceBoolean("hideWatched", false)) {
if ("indexedDB" in window) {
- const request = indexedDB.open("piped-db", 1);
- request.onupgradeneeded = function () {
+ const request = indexedDB.open("piped-db", 2);
+ request.onupgradeneeded = ev => {
const db = request.result;
console.log("Upgrading object store.");
if (!db.objectStoreNames.contains("watch_history")) {
@@ -51,6 +51,10 @@ export default {
store.createIndex("video_id_idx", "videoId", { unique: true });
store.createIndex("id_idx", "id", { unique: true, autoIncrement: true });
}
+ if (ev.oldVersion < 2) {
+ const store = request.transaction.objectStore("watch_history");
+ store.createIndex("watchedAt", "watchedAt", { unique: false });
+ }
};
request.onsuccess = e => {
window.db = e.target.result;
@@ -63,14 +67,16 @@ export default {
const App = this;
(async function () {
- const defaultLang = await App.defaultLangage;
+ const defaultLang = await App.defaultLanguage;
const locale = App.getPreferenceString("hl", defaultLang);
if (locale !== App.TimeAgoConfig.locale) {
- const localeTime = await import(
- "./../node_modules/javascript-time-ago/locale/" + locale + ".json"
- ).then(module => module.default);
- App.TimeAgo.addLocale(localeTime);
- App.TimeAgoConfig.locale = locale;
+ const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`)
+ .catch(() => null)
+ .then(module => module?.default);
+ if (localeTime) {
+ App.TimeAgo.addLocale(localeTime);
+ App.TimeAgoConfig.locale = locale;
+ }
}
if (window.i18n.global.locale.value !== locale) {
if (!window.i18n.global.availableLocales.includes(locale)) {
diff --git a/src/components/ChannelItem.vue b/src/components/ChannelItem.vue
new file mode 100644
index 00000000..84557629
--- /dev/null
+++ b/src/components/ChannelItem.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue
index d08ce459..1ef8a400 100644
--- a/src/components/ChannelPage.vue
+++ b/src/components/ChannelPage.vue
@@ -30,18 +30,32 @@
v-if="channel.id"
:href="`${apiUrl()}/feed/unauthenticated/rss?channels=${channel.id}`"
target="_blank"
- class="btn flex-col ml-3"
+ class="btn flex-col mx-3"
>
@@ -39,7 +39,7 @@ export default { if (window.db) { var tx = window.db.transaction("watch_history", "readonly"); var store = tx.objectStore("watch_history"); - const cursorRequest = store.openCursor(); + const cursorRequest = store.index("watchedAt").openCursor(null, "prev"); cursorRequest.onsuccess = e => { const cursor = e.target.result; if (cursor) { @@ -53,7 +53,6 @@ export default { thumbnail: video.thumbnail, watchedAt: video.watchedAt, }); - this.videos.sort((a, b) => b.watchedAt - a.watchedAt); // TODO: Optimize if (this.videos.length < 1000) cursor.continue(); } }; diff --git a/src/components/PlaylistItem.vue b/src/components/PlaylistItem.vue new file mode 100644 index 00000000..84557629 --- /dev/null +++ b/src/components/PlaylistItem.vue @@ -0,0 +1,34 @@ + +
+ +
+
++ +
+
++ + + +
+