add to playlist can now check for duplicates, seperated apple music playlists from playlists
This commit is contained in:
parent
7042c97264
commit
b0c5a07b0f
7 changed files with 46 additions and 7 deletions
|
@ -353,7 +353,7 @@
|
||||||
"settings.option.experimental.close_button_hide": "Close Button Should Hide the Application",
|
"settings.option.experimental.close_button_hide": "Close Button Should Hide the Application",
|
||||||
"settings.option.experimental.inline_playlists": "Inline Playlists and Albums",
|
"settings.option.experimental.inline_playlists": "Inline Playlists and Albums",
|
||||||
"settings.option.advanced.playlistTrackMapping": "Playlist Track Mapping",
|
"settings.option.advanced.playlistTrackMapping": "Playlist Track Mapping",
|
||||||
"settings.option.advanced.playlistTrackMapping.description": "Enables deep scanning of playlists to determine which tracks are in which playlists.",
|
"settings.option.advanced.playlistTrackMapping.description": "Enables deep scanning of playlists to determine which tracks are in which playlists. Playlist cache build times can increase significantly.",
|
||||||
"spatial.notTurnedOn": "Audio Spatialization is disabled. To use, please enable it first.",
|
"spatial.notTurnedOn": "Audio Spatialization is disabled. To use, please enable it first.",
|
||||||
"spatial.spatialProperties": "Spatial Properties",
|
"spatial.spatialProperties": "Spatial Properties",
|
||||||
"spatial.width": "Width",
|
"spatial.width": "Width",
|
||||||
|
|
|
@ -353,7 +353,7 @@
|
||||||
"settings.option.experimental.close_button_hide": "Close Button Should Hide the Application",
|
"settings.option.experimental.close_button_hide": "Close Button Should Hide the Application",
|
||||||
"settings.option.experimental.inline_playlists": "Inline Playlists and Albums",
|
"settings.option.experimental.inline_playlists": "Inline Playlists and Albums",
|
||||||
"settings.option.advanced.playlistTrackMapping": "Playlist Track Mapping",
|
"settings.option.advanced.playlistTrackMapping": "Playlist Track Mapping",
|
||||||
"settings.option.advanced.playlistTrackMapping.description": "Enables deep scanning of playlists to determine which tracks are in which playlists.",
|
"settings.option.advanced.playlistTrackMapping.description": "Enables deep scanning of playlists to determine which tracks are in which playlists. Playlist cache build times can increase significantly.",
|
||||||
"spatial.notTurnedOn": "Audio Spatialization is disabled. To use, please enable it first.",
|
"spatial.notTurnedOn": "Audio Spatialization is disabled. To use, please enable it first.",
|
||||||
"spatial.spatialProperties": "Spatial Properties",
|
"spatial.spatialProperties": "Spatial Properties",
|
||||||
"spatial.width": "Width",
|
"spatial.width": "Width",
|
||||||
|
|
|
@ -992,8 +992,9 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async refreshPlaylists(localOnly = false, trackMap = true) {
|
async refreshPlaylists(localOnly = false) {
|
||||||
let self = this
|
let self = this
|
||||||
|
let trackMap = this.cfg.advanced.playlistTrackMapping
|
||||||
let newListing = []
|
let newListing = []
|
||||||
let trackMapping = {}
|
let trackMapping = {}
|
||||||
const cachedPlaylist = await CiderCache.getCache("library-playlists")
|
const cachedPlaylist = await CiderCache.getCache("library-playlists")
|
||||||
|
@ -1023,6 +1024,12 @@ const app = new Vue({
|
||||||
const playlistData = await app.mk.api.v3.music(`/v1/me/library/playlist-folders/${parent}/children/`)
|
const playlistData = await app.mk.api.v3.music(`/v1/me/library/playlist-folders/${parent}/children/`)
|
||||||
await asyncForEach(playlistData.data.data, async (playlist) => {
|
await asyncForEach(playlistData.data.data, async (playlist) => {
|
||||||
playlist.parent = parent
|
playlist.parent = parent
|
||||||
|
if(
|
||||||
|
playlist.type != "library-playlist-folders" &&
|
||||||
|
typeof playlist.attributes.playParams["versionHash"] != "undefined"
|
||||||
|
) {
|
||||||
|
playlist.parent = "p.applemusic"
|
||||||
|
}
|
||||||
playlist.children = []
|
playlist.children = []
|
||||||
playlist.tracks = []
|
playlist.tracks = []
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -789,6 +789,14 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
|
||||||
-webkit-user-drag: element;
|
-webkit-user-drag: element;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
.presentNotice {
|
||||||
|
align-self: center;
|
||||||
|
margin-left: 8px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 0.7em;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,13 @@
|
||||||
<sidebar-library-item :name="$root.getLz('term.podcasts')" svg-icon="./assets/feather/mic.svg"
|
<sidebar-library-item :name="$root.getLz('term.podcasts')" svg-icon="./assets/feather/mic.svg"
|
||||||
page="podcasts">
|
page="podcasts">
|
||||||
</sidebar-library-item>
|
</sidebar-library-item>
|
||||||
|
<template v-if="getPlaylistFolderChildren('p.applemusic').length != 0">
|
||||||
|
<div class="app-sidebar-header-text" @contextmenu="playlistHeaderContextMenu">
|
||||||
|
{{ $root.getLz('term.appleMusic') }} {{ $root.getLz('term.playlists') }}
|
||||||
|
</div>
|
||||||
|
<sidebar-playlist v-for="item in getPlaylistFolderChildren('p.applemusic')" :item="item">
|
||||||
|
</sidebar-playlist>
|
||||||
|
</template>
|
||||||
<div class="app-sidebar-header-text" @contextmenu="playlistHeaderContextMenu">
|
<div class="app-sidebar-header-text" @contextmenu="playlistHeaderContextMenu">
|
||||||
{{ $root.getLz('term.playlists') }}
|
{{ $root.getLz('term.playlists') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="icon"><%- include("../svg/plus.svg") %></div>
|
<div class="icon"><%- include("../svg/plus.svg") %></div>
|
||||||
<div class="name">{{app.getLz('action.createPlaylist')}}</div>
|
<div class="name">{{app.getLz('action.createPlaylist')}}</div>
|
||||||
</button>
|
</button>
|
||||||
<sidebar-playlist :playlist-select="playlistSelect" v-for="item in $root.getPlaylistFolderChildren('p.playlistsroot')" :item="item">
|
<sidebar-playlist :playlist-select="playlistSelect" :relate-media-items="relateItems" v-for="item in $root.getPlaylistFolderChildren('p.playlistsroot')" :item="item">
|
||||||
</sidebar-playlist>
|
</sidebar-playlist>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-search">
|
<div class="modal-search">
|
||||||
|
@ -42,6 +42,7 @@
|
||||||
searchQuery: "",
|
searchQuery: "",
|
||||||
focused: "",
|
focused: "",
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
|
relateItems: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.relateItems = [this.$root.selectedMediaItems[0].id]
|
||||||
this.search()
|
this.search()
|
||||||
this.$refs.searchInput.focus()
|
this.$refs.searchInput.focus()
|
||||||
this.$refs.searchInput.addEventListener('keydown', (e) => {
|
this.$refs.searchInput.addEventListener('keydown', (e) => {
|
||||||
|
|
|
@ -9,13 +9,14 @@
|
||||||
:href="item.href"
|
:href="item.href"
|
||||||
@click='clickEvent()'>
|
@click='clickEvent()'>
|
||||||
<template v-if="!renaming">
|
<template v-if="!renaming">
|
||||||
<div class="sidebar-icon" v-html="icon"></div> {{ item.attributes.name }}
|
<div class="sidebar-icon" :key="item.id" v-html="icon"></div> {{ item.attributes.name }}
|
||||||
|
<small class="presentNotice" v-if="hasRelatedMediaItems">(Track present)</small>
|
||||||
</template>
|
</template>
|
||||||
<input type="text" v-model="item.attributes.name" class="pl-rename-field" @blur="rename()" @keydown.enter="rename()" v-else>
|
<input type="text" v-model="item.attributes.name" class="pl-rename-field" @blur="rename()" @keydown.enter="rename()" v-else>
|
||||||
</button>
|
</button>
|
||||||
<div class="folder-body" v-if="item.type === 'library-playlist-folders' && folderOpened">
|
<div class="folder-body" v-if="item.type === 'library-playlist-folders' && folderOpened">
|
||||||
<template v-if="children.length != 0">
|
<template v-if="children.length != 0">
|
||||||
<sidebar-playlist v-for="item in children" :playlist-select="playlistSelect" :item="item" :key="item.id"></sidebar-playlist>
|
<sidebar-playlist v-for="item in children" :relate-media-items="relateMediaItems" :playlist-select="playlistSelect" :item="item" :key="item.id"></sidebar-playlist>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="spinner"></div>
|
<div class="spinner"></div>
|
||||||
|
@ -35,6 +36,13 @@
|
||||||
playlistSelect: {
|
playlistSelect: {
|
||||||
type: Function,
|
type: Function,
|
||||||
required: false
|
required: false
|
||||||
|
},
|
||||||
|
relateMediaItems: {
|
||||||
|
type: Array,
|
||||||
|
required: false,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
|
@ -43,7 +51,8 @@
|
||||||
children: [],
|
children: [],
|
||||||
playlistRoot: "p.playlistsroot",
|
playlistRoot: "p.playlistsroot",
|
||||||
renaming: false,
|
renaming: false,
|
||||||
icon: ""
|
icon: "",
|
||||||
|
hasRelatedMediaItems: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
@ -52,6 +61,12 @@
|
||||||
} else {
|
} else {
|
||||||
this.icon = await this.$root.getSvgIcon("./assets/feather/folder.svg")
|
this.icon = await this.$root.getSvgIcon("./assets/feather/folder.svg")
|
||||||
}
|
}
|
||||||
|
let playlistMap = this.$root.playlists.trackMapping
|
||||||
|
if(this.relateMediaItems.length != 0) {
|
||||||
|
if(playlistMap[this.relateMediaItems[0]].includes(this.item.id)) {
|
||||||
|
this.hasRelatedMediaItems = true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue