diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 1de20eb8..38fbb5eb 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -39,6 +39,9 @@
  • +
  • + +
  • diff --git a/src/components/PlaylistAddModal.vue b/src/components/PlaylistAddModal.vue new file mode 100644 index 00000000..33057f3c --- /dev/null +++ b/src/components/PlaylistAddModal.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/components/PlaylistPage.vue b/src/components/PlaylistPage.vue index ad714bd0..69a52505 100644 --- a/src/components/PlaylistPage.vue +++ b/src/components/PlaylistPage.vue @@ -26,9 +26,13 @@
    @@ -48,6 +52,7 @@ export default { data() { return { playlist: null, + admin: false, }; }, computed: { @@ -57,6 +62,16 @@ export default { }, mounted() { this.getPlaylistData(); + const playlistId = this.$route.query.list; + if (this.authenticated && playlistId?.length == 36) + this.fetchJson(this.apiUrl() + "/user/playlists", null, { + headers: { + Authorization: this.getAuthToken(), + }, + }).then(json => { + if (json.error) alert(json.error); + else if (json.filter(playlist => playlist.id === playlistId).length > 0) this.admin = true; + }); }, activated() { window.addEventListener("scroll", this.handleScroll); @@ -87,6 +102,9 @@ export default { }); } }, + removeVideo(index) { + this.playlist.relatedStreams.splice(index, 1); + }, }, }; diff --git a/src/components/PlaylistsPage.vue b/src/components/PlaylistsPage.vue new file mode 100644 index 00000000..c4d30794 --- /dev/null +++ b/src/components/PlaylistsPage.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index 2bc279b8..37f7a26c 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -24,7 +24,7 @@
    -
    +
    + + +
    @@ -82,6 +94,8 @@ diff --git a/src/locales/en.json b/src/locales/en.json index 181a02cc..665f26ab 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -6,7 +6,8 @@ "feed": "Feed", "preferences": "Preferences", "history": "History", - "subscriptions": "Subscriptions" + "subscriptions": "Subscriptions", + "playlists": "Playlists" }, "player": { "watch_on": "Watch on {0}" @@ -70,7 +71,15 @@ "clear_history": "Clear History", "show_replies": "Show Replies", "hide_replies": "Hide Replies", - "load_more_replies": "Load more Replies" + "load_more_replies": "Load more Replies", + "add_to_playlist": "Add to playlist", + "remove_from_playlist": "Remove from playlist", + "delete_playlist_video_confirm": "Are you sure you would like to remove this video from this playlist?", + "create_playlist": "Create Playlist", + "delete_playlist": "Delete Playlist", + "select_playlist": "Select a Playlist", + "delete_playlist_confirm": "Are you sure you want to delete this playlist?", + "please_select_playlist": "Please select a playlist" }, "comment": { "pinned_by": "Pinned by" diff --git a/src/main.js b/src/main.js index ed1e2531..37bc9250 100644 --- a/src/main.js +++ b/src/main.js @@ -14,6 +14,9 @@ import { faTv, faLevelUpAlt, faBroadcastTower, + faCirclePlus, + faCircleMinus, + faXmark, } from "@fortawesome/free-solid-svg-icons"; import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; @@ -34,6 +37,9 @@ library.add( faLevelUpAlt, faTv, faBroadcastTower, + faCirclePlus, + faCircleMinus, + faXmark, ); import router from "@/router/router.js"; diff --git a/src/router/router.js b/src/router/router.js index 085f0f93..3afcabed 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -70,6 +70,11 @@ const routes = [ name: "Watch History", component: () => import("../components/HistoryPage.vue"), }, + { + path: "/playlists", + name: "Playlists", + component: () => import("../components/PlaylistsPage.vue"), + }, ]; const router = createRouter({