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.inline_playlists": "Inline Playlists and Albums",
|
||||
"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.spatialProperties": "Spatial Properties",
|
||||
"spatial.width": "Width",
|
||||
|
|
|
@ -353,7 +353,7 @@
|
|||
"settings.option.experimental.close_button_hide": "Close Button Should Hide the Application",
|
||||
"settings.option.experimental.inline_playlists": "Inline Playlists and Albums",
|
||||
"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.spatialProperties": "Spatial Properties",
|
||||
"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 trackMap = this.cfg.advanced.playlistTrackMapping
|
||||
let newListing = []
|
||||
let trackMapping = {}
|
||||
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/`)
|
||||
await asyncForEach(playlistData.data.data, async (playlist) => {
|
||||
playlist.parent = parent
|
||||
if(
|
||||
playlist.type != "library-playlist-folders" &&
|
||||
typeof playlist.attributes.playParams["versionHash"] != "undefined"
|
||||
) {
|
||||
playlist.parent = "p.applemusic"
|
||||
}
|
||||
playlist.children = []
|
||||
playlist.tracks = []
|
||||
try {
|
||||
|
|
|
@ -789,6 +789,14 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
|
|||
-webkit-user-drag: element;
|
||||
overflow: hidden;
|
||||
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"
|
||||
page="podcasts">
|
||||
</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">
|
||||
{{ $root.getLz('term.playlists') }}
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="icon"><%- include("../svg/plus.svg") %></div>
|
||||
<div class="name">{{app.getLz('action.createPlaylist')}}</div>
|
||||
</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>
|
||||
</div>
|
||||
<div class="modal-search">
|
||||
|
@ -42,6 +42,7 @@
|
|||
searchQuery: "",
|
||||
focused: "",
|
||||
app: this.$root,
|
||||
relateItems: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -51,6 +52,7 @@
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.relateItems = [this.$root.selectedMediaItems[0].id]
|
||||
this.search()
|
||||
this.$refs.searchInput.focus()
|
||||
this.$refs.searchInput.addEventListener('keydown', (e) => {
|
||||
|
|
|
@ -9,13 +9,14 @@
|
|||
:href="item.href"
|
||||
@click='clickEvent()'>
|
||||
<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>
|
||||
<input type="text" v-model="item.attributes.name" class="pl-rename-field" @blur="rename()" @keydown.enter="rename()" v-else>
|
||||
</button>
|
||||
<div class="folder-body" v-if="item.type === 'library-playlist-folders' && folderOpened">
|
||||
<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 v-else>
|
||||
<div class="spinner"></div>
|
||||
|
@ -35,6 +36,13 @@
|
|||
playlistSelect: {
|
||||
type: Function,
|
||||
required: false
|
||||
},
|
||||
relateMediaItems: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data: function () {
|
||||
|
@ -43,7 +51,8 @@
|
|||
children: [],
|
||||
playlistRoot: "p.playlistsroot",
|
||||
renaming: false,
|
||||
icon: ""
|
||||
icon: "",
|
||||
hasRelatedMediaItems: false
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
@ -52,6 +61,12 @@
|
|||
} else {
|
||||
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: {
|
||||
clickEvent() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue