Merge pull request #2 from ciderapp/develop

Develop
This commit is contained in:
Amaru8 2022-04-22 11:50:20 +02:00 committed by GitHub
commit fe12512138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 2294 additions and 2329 deletions

View file

@ -22,13 +22,13 @@ jobs:
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "cider-yarn.lock" }}
- yarn-packages-{{ checksum "cider.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "cider-yarn.lock" }}
key: yarn-packages-{{ checksum "cider.lock" }}
paths:
- ~/.cache/yarn
- run:

File diff suppressed because it is too large Load diff

View file

@ -35,8 +35,8 @@
"circle:script": "node resources/circle"
},
"dependencies": {
"@sentry/electron": "^3.0.2",
"@sentry/integrations": "^6.18.1",
"@sentry/electron": "^3.0.7",
"@sentry/integrations": "^6.19.6",
"adm-zip": "0.4.10",
"castv2-client": "^1.2.0",
"chokidar": "^3.5.3",
@ -44,22 +44,23 @@
"ejs": "^3.1.6",
"electron-fetch": "^1.7.4",
"electron-log": "^4.4.6",
"electron-notarize": "^1.1.1",
"electron-notarize": "^1.2.1",
"electron-store": "^8.0.1",
"electron-updater": "^4.6.5",
"electron-updater": "^5.0.1",
"electron-window-state": "^5.0.3",
"express": "^4.17.3",
"get-port": "^5.1.1",
"jsonc": "^2.0.0",
"lastfmapi": "^0.1.1",
"dns-js": "git+https://github.com/ciderapp/node-dns-js.git",
"mdns-js": "git+https://github.com/ciderapp/node-mdns-js.git",
"mpris-service": "^2.1.2",
"music-metadata": "^7.12.1",
"node-gyp": "^8.4.1",
"music-metadata": "^7.12.3",
"node-gyp": "^9.0.0",
"node-ssdp": "^4.0.1",
"qrcode": "^1.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"run-script-os": "^1.1.6",
"source-map-support": "^0.5.21",
"v8-compile-cache": "^2.3.0",
@ -69,18 +70,19 @@
"youtube-search-without-api-key": "^1.0.7"
},
"devDependencies": {
"@types/discord-rpc": "4.0.0",
"@types/discord-rpc": "4.0.2",
"@types/express": "^4.17.13",
"@types/qrcode-terminal": "^0.12.0",
"@types/ws": "^8.5.1",
"@types/ws": "^8.5.3",
"@types/adm-zip": "^0.5.0",
"electron": "git+https://github.com/castlabs/electron-releases.git",
"electron-builder": "^22.14.13",
"electron-builder": "^23.0.3",
"electron-builder-notarize-pkg": "^1.2.0",
"electron-webpack": "^2.8.2",
"musickit-typescript": "^1.2.4",
"typescript": "^4.6.2",
"typescript": "^4.6.3",
"vue-devtools": "^5.1.4",
"webpack": "~5.69.1"
"webpack": "~5.72.0"
},
"fileAssociations": [
{

View file

@ -2,7 +2,7 @@
Some notes about Cider's i18n support.
- Localization files are stored in jsonc format aka "JSON with Comments"
- Localization files are stored in `json` format aka "JavaScript Object Notation".
- The default language is English.
- The default language is used for messages that are not translated.
- Try when possible to keep the messages the similar in length to the English ones.
@ -29,7 +29,6 @@ How it is implemented for English:
```
## Localization Notices
Several changes have been made to configuration options and will be listed below with the relevant locales that have
@ -190,18 +189,22 @@ Update 28/02/2022 13:00 UTC
* `term.time.day`: Added for `en_US`
Update 10/03/2022 14:00 UTC
* `settings.header.window`: Added for `en_US`
* `settings.header.window.description`: Added for `en_US`
* `settings.option.window.openOnStartup`: Added for `en_US`
* `settings.option.window.openOnStartup.hidden`: Added for `en_US`
Update 20/03/2022 00:01 UTC
* `term.creditDesignedBy`: Added for `en_US`
Update 29/03/2022 04:00 UTC
* `settings.option.audio.enableAdvancedFunctionality.ciderPPE.description`: Changed for `en_US` (Deleted for all language files)
Update 06/04/2022 08:30 UTC
* `settings.option.general.customizeSidebar`: Added for `en_US`
* `settings.option.general.customizeSidebar.customize`: Added for `en_US`
* `settings.option.window.useNativeTitleBar`: Added for `en_US`
@ -247,6 +250,7 @@ Update 09/04/2022 13:45 UTC
* `action.tray.show`: Changed for `en_US` (Deleted for all language files)
Update 14/04/2022 14:30 UTC
* `term.variables`: Added for `en_US`
* `settings.option.connectivity.discordRPC.clientName`: Added for `en_US`
* `settings.option.connectivity.discordRPC.detailsFormat`: Added for `en_US`

View file

@ -10,6 +10,7 @@
"notification.updatingLibrarySongs": "Zenekönyvtár frissítése...",
"notification.updatingLibraryAlbums": "Albumok frissítése...",
"notification.updatingLibraryArtists": "Előadók frissítése...",
"term.variables": "Változók",
"term.appleInc": "Apple Inc.",
"term.appleMusic": "Apple Music",
"term.applePodcasts": "Apple Podcasts",
@ -386,12 +387,13 @@
"settings.option.lyrics.enableYoutubeLyrics": "YouTube dalszövegek engedélyezése a zenei videóknál",
"settings.header.connectivity": "Csatlakozások",
"settings.header.connectivity.description": "A Cider csatlakozás beállításainak módosítása.",
"settings.option.connectivity.discordRPC": "Discord Rich Presence",
"settings.option.connectivity.playbackNotifications": "Lejátszási értesítések",
"settings.header.connectivity.discordRPC.cider": "Megjelenítés 'Cider'-ként",
"settings.header.connectivity.discordRPC.appleMusic": "Megjelenítés 'Apple Music'-ként",
"settings.option.connectivity.discordRPC": "Discord Rich Presence",
"settings.option.connectivity.discordRPC.clientName": "Kliensnév",
"settings.option.connectivity.discordRPC.clearOnPause": "Rich Presence törlése megállításnál",
"settings.option.connectivity.discordRPC.hideButtons": "Rich Presence gombok elrejtése",
"settings.option.connectivity.discordRPC.detailsFormat": "Részletek formátuma",
"settings.option.connectivity.discordRPC.stateFormat": "Állapot formátuma",
"settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling",
"settings.option.connectivity.lastfmScrobble.delay": "Last.fm Scrobble késleltetés (%)",
"settings.option.connectivity.lastfmScrobble.nowPlaying": "Last.fm Now Playing engedélyezése",

View file

@ -14,11 +14,8 @@ import {utils} from './utils';
import {Plugins} from "./plugins";
import {watch} from "chokidar";
import * as os from "os";
const wallpaper = require('wallpaper');
// @ts-ignore
import wallpaper from "wallpaper";
import * as AdmZip from "adm-zip";
import * as util from "util";
/**
* @file Creates the BrowserWindow
@ -531,6 +528,7 @@ export class BrowserWindow {
app.get("/connect/set-cc-user/:data", (req, res) => {
//utils.getStoreValue('connectUser', JSON.parse()) // [Connect] Save user in store
utils.setStoreValue('connectUser', JSON.parse(req.params.data))
utils.getWindow().reload()
res.redirect(`https://connect.cidercollective.dev/linked.html`)
});
// [Connect] Set auth URL in store for `shell.openExternal`
@ -552,7 +550,7 @@ export class BrowserWindow {
remote.use(express.static(join(utils.getPath('srcPath'), "./web-remote/")))
remote.set("views", join(utils.getPath('srcPath'), "./web-remote/views"));
remote.set("view engine", "ejs");
getPort({port: 6942}).then((port) => {
getPort({port: 6942}).then((port: number) => {
this.remotePort = port;
// Start Remote Discovery
this.broadcastRemote()
@ -615,7 +613,8 @@ export class BrowserWindow {
details.requestHeaders['Accept-Language'] = 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
details.requestHeaders['Referer'] = 'https://y.qq.com/',
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 ('
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '}
'KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) '
}
if (details.url.includes("https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg")) {
details.requestHeaders['Accept'] = '*/*',
details.requestHeaders['Accept-Encoding'] = 'gzip, deflate, br',
@ -647,6 +646,35 @@ export class BrowserWindow {
* ipcMain Events
****************************************************************************************************************** */
ipcMain.handle("mkv3", async (event, args) => {
const options = {
route: "",
token: "",
mediaToken: "",
GETBody: {}
}
Object.assign(options, args);
let res = await fetch(
`https://amp-api.music.apple.com/${options.route}?${new URLSearchParams({
...options.GETBody
}).toString()}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
authorization: `Bearer ${options.token}`,
path: options.route,
authority: "amp-api.music.apple.com",
"media-user-token": options.mediaToken,
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cider/1.4.2 Chrome/100.0.4896.75 Electron/18.0.3 Safari/537.36"
},
}
);
let json = await res.json();
return json;
})
ipcMain.on("get-wallpaper", async (event) => {
const wpPath: string = await wallpaper.get();
// get the wallpaper and encode it to base64 then return

View file

@ -155,21 +155,29 @@ export class Store {
"AudioContext": false,
"experiments": [],
"playlistTrackMapping": true
}
},
"connectUser": {
"auth": null,
},
}
private migrations: any = {
'>=1.4.3': (store: ElectronStore) => {
if (typeof(store.get('general.discord_rpc')) == 'number' || typeof(store.get('general.discord_rpc')) == 'string') {
if (typeof store.get('general.discord_rpc') == 'number' || typeof store.get('general.discord_rpc') == 'string') {
store.delete('general.discord_rpc');
store.set('general.discord_rpc', this.defaults.general.discord_rpc)
}
},
}
private schema: ElectronStore.Schema<any> = {
"general.discord_rpc": {
type: 'object'
},
}
constructor() {
Store.cfg = new ElectronStore({
name: 'cider-config',
defaults: this.defaults,
schema: this.schema,
migrations: this.migrations,
clearInvalidConfig: true
});

View file

@ -50,12 +50,13 @@ app.on('ready', () => {
})
console.log('[Cider][Widevine] Status:', components.status());
win.show();
win.on("ready-to-show", () => {
Cider.bwCreated();
console.debug('[Cider] Window is Ready.')
CiderPlug.callPlugins('onReady', win);
win.show();
});
});

View file

@ -137,11 +137,21 @@ export default class DiscordRPC {
}
})
// Checks if the name is greater than 128 because some songs can be that long
if (activity.details && activity.details.length > 128) {
// Checks if the details is greater than 128 because some songs can be that long
if (activity.details && activity.details.length >= 128) {
activity.details = activity.details.substring(0, 125) + '...'
}
// Checks if the state is greater than 128 because some songs can be that long
if (activity.state && activity.state.length >= 128) {
activity.state = activity.state.substring(0, 125) + '...'
}
// Checks if the state is greater than 128 because some songs can be that long
if (activity.largeImageText && activity.largeImageText.length >= 128) {
activity.largeImageText = activity.largeImageText.substring(0, 125) + '...'
}
// Check large image
if (activity.largeImageKey == null || activity.largeImageKey === "" || activity.largeImageKey.length > 256) {
activity.largeImageKey = "cider";
@ -179,7 +189,7 @@ export default class DiscordRPC {
// Set the activity
if (!this._attributes.status && this._utils.getStoreValue("general.discord_rpc.clear_on_pause")) {
this._client.clearActivity()
} else {
} else if (this._activity && this._activityCache !== this._activity && this._activity.details) {
this._client.setActivity(activity)
this._activityCache = this._activity;
}

View file

@ -102,6 +102,12 @@ export default class Thumbar {
]
},
{type: 'separator'},
{
label: 'Toggle Private Session',
accelerator: 'CommandOrControl+P',
click: () => this._win.webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`)
},
{type: 'separator'},
{
label: 'Web Remote',
accelerator: 'CommandOrControl+Shift+W',
@ -209,7 +215,7 @@ export default class Thumbar {
{type: 'separator'},
{
label: 'Toggle Developer Tools',
accelerator: 'Option+CommandOrControl+I',
accelerator: 'Option+CommandOrControl+Shift+I',
click: () => this._win.webContents.openDevTools()
},
{

View file

@ -991,6 +991,18 @@
opacity : 0;
}
.fade {
transition: opacity 0.15s var(--appleEase);
}
@media (prefers-reduced-motion: reduce) {
.fade {
transition: none;
}
}
.fade:not(.show) {
opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
.modal.fade .modal-dialog {
transition: none;
@ -2424,6 +2436,7 @@ fieldset:disabled .btn {
-webkit-user-drag: none;
// transition: transform .35s var(--appleEase), background-color .35s var(--appleEase);
font-weight: 500;
margin: 0px 4px;
&:hover {
// transition: transform .35s var(--appleEase), background-color 0s var(--appleEase);
background-color: var(--hover);

View file

@ -1862,3 +1862,106 @@ input[type=checkbox][switch]:checked:active::before {
.search-tab.active {
background: var(--keyColor);
}
// fancy pills
.nav-pills {
position : relative;
.nav-link {
transition: transform .3s var(--appleEase);
position : relative;
&:after {
--dist: 1px;
content : "";
position : absolute;
top : var(--dist);
bottom : var(--dist);
left : var(--dist);
right : var(--dist);
// width : 100%;
// height : 100%;
background-color: transparent;
border-radius : 50px;
z-index : -1;
opacity : 0;
transition: background-color .5s var(--appleEase), opacity 0.25s var(--appleEase), border-radius .32s var(--appleEase);
}
&:hover {
outline : none;
transform : scale(1.1);
// background: #eee;
background : transparent;
color : #333;
&:after {
opacity: 1;
background-color: #eee;
transition: background-color .25s var(--appleEase),
border-radius .25s var(--appleEase),
color .0s var(--appleEase),
opacity 0.0s var(--appleEase);
}
}
&.active {
outline : none;
transform : scale(1.1);
// background: #eee;
background : transparent;
color : #333;
&:after {
opacity: 1;
background-color: #eee;
}
}
}
&:hover {
.nav-link.active {
outline : none;
transform : scale(1.0);
background: transparent;
color: #eee;
transform : scale(1.0);
&:after {
background : rgb(200 200 200 / 15%);
opacity : 1;
transition: color 0s;
// border-radius: 5px;
--dist: 4px;
}
&:hover {
transform : scale(1.1);
z-index : 1;
color : #333;
&:after {
background: #eee;
border-radius: inherit;
--dist: 1px;
}
}
}
}
&:after {
content : '';
position : absolute;
top : 0;
left : 0;
bottom : 0;
right : 0;
background : rgb(200 200 200 / 10%);
border-radius : 50px;
z-index : 0;
pointer-events: none;
}
}

View file

@ -493,10 +493,51 @@
//background: linear-gradient(180deg, var(--bgColor) 32px, var(--bgColor) 18px, transparent 60px, transparent 100%);
top : 0;
padding-top : var(--navigationBarHeight);
display:flex;
flex-direction: column;
height: 100%;
overflow: hidden;
.mediaContainer {
transition: width 0.5s ease-in-out, height 0.5s ease-in-out;
width: 260px;height:260px;
}
.playlist-body {
padding : var(--contentInnerPadding) 2em;
margin-top: -75px;
padding : 32px;
// margin-top: -75px;
overflow-y:overlay;
height:100%;
padding:0px;
background-color: var(--color1);
&.scrollbody {
.tabs {
display: flex;
flex-flow: column;
height: 100%;
.nav-link {
text-transform:capitalize;
}
.tab-content {
height: 100%;
overflow: hidden;
margin:0px;
.tab-pane {
height: 100%;
overflow-y: overlay;
overflow-x:hidden;
padding: var(--contentInnerPadding);
-webkit-mask-image: linear-gradient(180deg, transparent, white 20px);
.well {
margin:0px;
}
}
}
}
}
}
.floating-header {
@ -510,12 +551,15 @@
background : rgba(0, 0, 0, 0.25);
top : var(--navigationBarHeight);
transition : opacity 0.1s var(--appleEase);
display: none;
}
.playlist-display {
padding : var(--contentInnerPadding);
min-height: 300px;
position : relative;
box-shadow: 0px 4px 6px 3px rgb(0 0 0 / 10%);
transition: min-height 0.5s ease-in-out;
.artworkContainer {
position : absolute;
@ -593,12 +637,14 @@
}
.playlist-desc {
transition: height .2s ease-in-out, opacity .2s ease-in-out;
box-sizing : border-box;
font-size : 14px;
flex-shrink : unset;
margin-right: 5px;
max-height : 100px;
position : relative;
height : 4vh;
.content {
height : 4vh;
@ -695,6 +741,8 @@
font-size: 0.9em;
margin : 6px;
opacity : 0.7;
transition: height .2s ease-in-out, opacity .2s ease-in-out;
height: 0.9em;
}
&.inline-playlist {
@ -739,6 +787,43 @@
}
}
}
.pilldim {
.nav-pills {
width: max-content;
margin: 0 auto;
margin-top: 16px;
}
}
&.plmin {
.playlist-display {
transition: min-height 0.5s ease-in-out;
min-height: 200px;
.playlistInfo {
}
.mediaContainer {
transition: width 0.5s ease-in-out, height 0.5s ease-in-out;
width: 128px!important;
height: 128px!important;
}
.playlist-time {
transition: height .2s ease-in-out, opacity .2s ease-in-out;
height: 0px;
opacity: 0;
}
.playlist-desc {
transition: height .2s ease-in-out, opacity .2s ease-in-out;
height: 0px!important;
opacity: 0;
}
}
}
}
@keyframes playlistArtworkFadeIn {
@ -1064,6 +1149,10 @@
font-size : 2em;
}
.settings-option-body-webview {
height: 100%;
width: 100%;
}
.settings-option-body {
margin: 16px;
}

View file

@ -1,34 +1,12 @@
const Events = {
InitEvents() {
const app = window.app
// Key binds
document.addEventListener('keydown', function (e) {
if (e.keyCode === 70 && e.ctrlKey) {
app.$refs.searchInput.focus()
app.$refs.searchInput.select()
}
});
// add event listener for when window.location.hash changes
window.addEventListener("hashchange", function () {
app.appRoute(window.location.hash)
});
// Key bind to unjam MusicKit in case it fails: CTRL+F10
document.addEventListener('keydown', function (event) {
if (event.ctrlKey && event.keyCode == 121) {
try {
app.mk._services.mediaItemPlayback._currentPlayer.stop()
} catch (e) {
}
try {
app.mk._services.mediaItemPlayback._currentPlayer.destroy()
} catch (e) {
}
}
});
window.addEventListener("mouseup", (e) => {
if (e.button === 3) {
e.preventDefault()
@ -39,7 +17,50 @@ const Events = {
}
});
document.addEventListener('keydown', function (event) {
document.addEventListener('keydown', async function (event) {
if (event.keyCode === 70 && event.ctrlKey) {
app.$refs.searchInput.focus()
app.$refs.searchInput.select()
}
// CTRL + R
if (event.keyCode === 82 && event.ctrlKey) {
event.preventDefault()
bootbox.confirm("Reload Cider?", (res)=>{
if(res) {
window.location.reload()
}
})
}
// CTRL + SHIFT + R
if (event.keyCode === 82 && event.ctrlKey && event.shiftKey) {
event.preventDefault()
window.location.reload()
}
// CTRL + E
if (event.keyCode === 69 && event.ctrlKey) {
app.invokeDrawer('queue')
}
// CTRL+H
if (event.keyCode === 72 && event.ctrlKey) {
app.appRoute("home")
}
// CTRL+SHIFT+H
if (event.ctrlKey && event.shiftKey && event.keyCode == 72) {
let hist = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, {
l: app.mklang
})
app.showCollection(hist.data, app.getLz('term.history'))
}
if (event.ctrlKey && event.keyCode == 121) {
try {
app.mk._services.mediaItemPlayback._currentPlayer.stop()
} catch (e) {
}
try {
app.mk._services.mediaItemPlayback._currentPlayer.destroy()
} catch (e) {
}
}
if (event.ctrlKey && event.keyCode == 122) {
try {
ipcRenderer.send('detachDT', '')

View file

@ -1,13 +1,27 @@
const MusicKitTools = {
async v3Backend({
route = "", getBody = {}, options = {}
}) {
return await (await ipcRenderer.invoke("mkv3", {
token: MusicKit.getInstance().developerToken,
route: route,
mediaToken: MusicKit.getInstance().musicUserToken,
GETBody: getBody
}))
},
async v3Continuous({
href,
options = {},
reqOptions = {},
onProgress = () => {},
onError = () => {},
onSuccess = () => {}
onProgress = () => {
},
onError = () => {
},
onSuccess = () => {
}
} = {}) {
let returnData = []
async function sendReq(href, options) {
const response = await app.mk.api.v3.music(href, options).catch(error => onError)

View file

@ -1652,7 +1652,8 @@ const app = new Vue({
params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialNotes,editorialVideo,name,playParams,releaseDate,url,copyright"
}
if (this.cfg.advanced.experiments.includes('inline-playlists')) {
// if (this.cfg.advanced.experiments.includes('inline-playlists')) {
if(false) {
let showModal = kind.toString().includes("album") || kind.toString().includes("playlist")
if (app.page.includes("playlist") || app.page.includes("album")) {
showModal = false

View file

@ -1228,6 +1228,18 @@ body[platform="darwin"] .app-chrome .app-chrome-item > .window-controls > div.cl
margin-bottom: 15px;
}
}
// Add Music Video Icons to Songs that are Music Videos
div[data-type="library-music-videos"] .info-rect .title::before,
div[data-type="musicVideo"] .info-rect .title::before {
content: "";
background-image: url(./assets/feather/video.svg);
background-size: contain;
filter:invert(0.6);
display: inline-block;
width: 20px;
height: 20px;
margin-bottom: -4px;
}
.app-chrome .app-chrome-item > .app-playback-controls .song-duration p {
font-weight: 400;

View file

@ -1,5 +1,4 @@
<script type="text/x-template" id="add-to-playlist">
<template>
<div class="modal-fullscreen addtoplaylist-panel" @click.self="app.resetState()" @contextmenu.self="app.resetState()">
<div class="modal-window">
<div class="modal-header">
@ -30,7 +29,6 @@
</div>
</div>
</div>
</template>
</script>
<script>

View file

@ -1,5 +1,5 @@
<script type="text/x-template" id="mediaitem-scroller-horizontal">
<vue-horizontal>
<vue-horizontal ref="horizontal">
<slot></slot>
<mediaitem-square :key="item?.id ?? ''" :kind="kind" :item="item" v-for="item in items"></mediaitem-square>
</vue-horizontal>
@ -24,6 +24,9 @@
app: this.$root,
}
},
mounted() {
// this.$refs.horizontal.refresh()
},
methods: {}
});
</script>

View file

@ -63,10 +63,13 @@
}
let playlistMap = this.$root.playlists.trackMapping
if (this.relateMediaItems.length != 0) {
if (playlistMap[this.relateMediaItems[0]]) {
if (playlistMap[this.relateMediaItems[0]].includes(this.item.id)) {
this.hasRelatedMediaItems = true
}
}
}
},
methods: {
clickEvent() {

View file

@ -5,7 +5,7 @@
<div class="settings-option-body">
<div class="md-option-line">
<b-jumbotron :header="$root.getLz('settings.option.audio.audioLab')"
lead="$root.getLz('settings.option.audio.audioLab.subheader')"></b-jumbotron>
:lead="$root.getLz('settings.option.audio.audioLab.subheader')"></b-jumbotron>
</div>
<div class="md-option-line" v-show="app.cfg.advanced.AudioContext === false">
<div class="md-option-segment">

View file

@ -1,5 +1,6 @@
<script type="text/x-template" id="cider-playlist">
<div class="content-inner playlist-page" v-if="data != [] && data.attributes != null"
<div class="content-inner playlist-page" :class="classes" v-if="data != [] && data.attributes != null"
:style="{'--bgColor': (data.attributes.artwork != null && data.attributes.artwork['bgColor'] != null) ? ('#' + data.attributes.artwork.bgColor) : ''}">
<template v-if="app.playlists.loadingState == 0">
<div class="content-inner centered">
@ -8,14 +9,15 @@
</template>
<template v-if="app.playlists.loadingState == 1">
<div class="playlist-display"
@mouseover.self="minClass(false)"
:style="{
'--bgColor': (data.attributes.artwork != null && data.attributes.artwork['bgColor'] != null) ? ('#' + data.attributes.artwork.bgColor) : '',
'--textColor': (data.attributes.artwork != null && data.attributes.artwork['textColor1'] != null) ? ('#' + data.attributes.artwork.textColor1) : ''
}">
<div class="playlistInfo">
<div class="row">
<div class="col-auto flex-center">
<div style="width: 260px;height:260px;">
<div class="col-auto flex-center" @mouseover="minClass(false)">
<div class="mediaContainer">
<mediaitem-artwork
shadow="large"
:video-priority="true"
@ -28,11 +30,11 @@
<div class="col playlist-info">
<template v-if="!editorialNotesExpanded">
<div>
<div class="playlist-name" @click="editPlaylistName()" v-show="!nameEditing">
<div class="playlist-name" @mouseover="minClass(false)" @click="editPlaylistName()" v-show="!nameEditing">
{{data.attributes ? (data.attributes.name ??
(data.attributes.title ?? '') ?? '') : ''}}
</div>
<div class="playlist-name" v-show="nameEditing"><input type="text"
<div class="playlist-name" @mouseover="minClass(false)" v-show="nameEditing"><input type="text"
spellcheck="false"
class="nameEdit"
v-model="data.attributes.name"
@ -50,10 +52,14 @@
<artist-chip v-for="artist in data.relationships.artists?.data"
:item="artist"></artist-chip>
</template>
<div class="playlist-desc" v-if="(data.attributes.description && (data.attributes.description.standard || data.attributes.description.short)) || (data.attributes.editorialNotes && (data.attributes.editorialNotes.standard || data.attributes.editorialNotes.short))">
<div v-if="(data.attributes.description?.short ?? data.attributes.editorialNotes?.short) != null" class="content"
v-html="data.attributes.description?.short ?? data.attributes.editorialNotes?.short" @click="openInfoModal()"></div>
<div v-else-if="(data.attributes.description?.standard ?? data.attributes.editorialNotes?.standard) != null" class="content"
<div class="playlist-desc"
v-if="(data.attributes.description && (data.attributes.description.standard || data.attributes.description.short)) || (data.attributes.editorialNotes && (data.attributes.editorialNotes.standard || data.attributes.editorialNotes.short))">
<div v-if="(data.attributes.description?.short ?? data.attributes.editorialNotes?.short) != null"
class="content"
v-html="data.attributes.description?.short ?? data.attributes.editorialNotes?.short"
@click="openInfoModal()"></div>
<div v-else-if="(data.attributes.description?.standard ?? data.attributes.editorialNotes?.standard) != null"
class="content"
v-html="data.attributes.description?.standard ?? data.attributes.editorialNotes?.standard"></div>
<!-- <button v-if="(data.attributes.description?.short ?? data.attributes.editorialNotes?.short ) != null" class="more-btn"
@click="editorialNotesExpanded = !editorialNotesExpanded">
@ -142,11 +148,16 @@
</div>
</div>
</div>
<div class="playlist-body">
<div class="well">
<div style="width:100%">
<div class="playlist-body scrollbody">
<b-tabs pills class="track-pills pilldim" align="center" content-class="mt-3">
<b-tab :title="$root.getLz('term.tracks')">
<div @wheel="minClass(true)" @scroll="minClass(true)">
<div class="">
<div style="width:100%" @click="minClass(true)">
<draggable :sort="data.attributes.canEdit && data.type == 'library-playlists'"
v-model="data.relationships.tracks.data" @start="drag=true" @end="drag=false;put()">
v-model="data.relationships.tracks.data" @start="drag=true"
@end="drag=false;put()">
<template v-if="nestedPlaylist == [] || nestedPlaylist.length <= 1">
<mediaitem-list-item :item="item" :parent="getItemParent(data)" :index="index"
:showIndex="true"
@ -156,8 +167,11 @@
</template>
<template v-else>
<div v-for="disc in nestedPlaylist">
<div class="playlist-time">{{($root.getLz("term.discNumber") ?? "").replace("${discNumber}",disc.disc)}}</div>
<mediaitem-list-item :item="item" :parent="getItemParent(data)" :index="index"
<div class="playlist-time">{{($root.getLz("term.discNumber") ??
"").replace("${discNumber}",disc.disc)}}
</div>
<mediaitem-list-item :item="item" :parent="getItemParent(data)"
:index="index"
:showIndex="true"
:showIndexPlaylist="(data.attributes.playParams.kind ?? data.type ?? '').includes('playlist')"
:context-ext="buildContextMenu()"
@ -173,7 +187,8 @@
<div class="friends-info" v-if="itemBadges.length != 0">
<div class="well">
<div class="badge-container">
<div class="socialBadge" :title="`${badge.attributes.name} - @${badge.attributes.handle}`"
<div class="socialBadge"
:title="`${badge.attributes.name} - @${badge.attributes.handle}`"
v-for="badge in itemBadges">
<mediaitem-artwork
:url="badge.attributes.artwork.url"
@ -192,14 +207,18 @@
</div>
<template
v-if="(data.attributes?.playParams?.kind ?? data.type ?? '').includes('album') && data.relationships.catalog != null && data.relationships.catalog != null && data.relationships.catalog.data.length > 0">
<div class="playlist-time showExtended item-navigate" style="color:#fa586a; font-weight: bold"
<div class="playlist-time showExtended item-navigate"
style="color:#fa586a; font-weight: bold"
@click="app.routeView(data.relationships.catalog.data[0])">
{{$root.getLz("action.showAlbum")}}
</div>
</template>
<hr>
<template v-if="typeof data.meta != 'undefined'">
<div v-for="view in data.meta.views.order" v-if="data.views[view].data.length != 0">
</div>
</b-tab>
<template v-if="typeof data.views != 'undefined'">
<b-tab lazy :title="data.views[view].attributes.title" v-for="view in data.meta.views.order"
v-if="data.views[view].data.length != 0">
<div >
<div class="row">
<div class="col">
<h3>{{ data.views[view].attributes.title }}</h3>
@ -212,8 +231,10 @@
</div>
</div>
</div>
</b-tab>
</template>
</b-tabs>
</div>
</template>
</div>
@ -238,6 +259,7 @@
headerVisible: true,
useArtistChip: false,
nestedPlaylist: [],
classes: [],
}
},
mounted: function () {
@ -254,6 +276,13 @@
}
},
methods: {
minClass(val) {
if (val) {
this.classes = ["plmin"]
} else {
this.classes = []
}
},
openInfoModal() {
app.moreinfodata = [];
app.moreinfodata = {
@ -269,7 +298,9 @@
if (this.data?.type?.includes("album")) {
console.log(this.data.relationships.tracks.data)
let songlists = this.data.relationships.tracks.data;
let discs = songlists.map(x => {return x.attributes.discNumber}).filter((item, i, ar) => ar.indexOf(item) === i);
let discs = songlists.map(x => {
return x.attributes.discNumber
}).filter((item, i, ar) => ar.indexOf(item) === i);
if (discs && discs.length > 1) {
for (disc of discs) {
let songs = songlists.filter(x => x.attributes.discNumber == disc);
@ -278,7 +309,8 @@
}
console.log(this.nestedPlaylist)
}},
}
},
isHeaderVisible(visible) {
this.headerVisible = visible
},
@ -462,7 +494,7 @@
}
})
},
menu(event) {
async menu(event) {
let self = this
let artistId = null
@ -474,7 +506,58 @@
}
let menuItems = {
headerItems: [
{
"icon": "./assets/feather/heart.svg",
"id": "love",
"name": app.getLz('action.love'),
"hidden": false,
"disabled": true,
"action": function () {
app.love(self.data)
}
},
{
"icon": "./assets/feather/heart.svg",
"id": "unlove",
"active": true,
"name": app.getLz('action.unlove'),
"hidden": true,
"action": function () {
app.unlove(self.data)
}
},
{
"icon": "./assets/feather/thumbs-down.svg",
"id": "dislike",
"name": app.getLz('action.dislike'),
"hidden": false,
"disabled": true,
"action": function () {
app.dislike(self.data)
}
},
{
"icon": "./assets/feather/thumbs-down.svg",
"id": "undo_dislike",
"name": app.getLz('action.undoDislike'),
"active": true,
"hidden": true,
"action": function () {
app.unlove(self.data)
}
},
],
items: {
"addToPlaylist": {
name: app.getLz('action.addToPlaylist'),
"icon": "./assets/feather/list.svg",
action: () => {
app.selectedMediaItems = []
app.select_selectMediaItem(this.data.attributes.playParams.id ?? this.data.id, this.data.attributes.playParams.kind ?? this.data.type, 0, 0, this.data.attributes.playParams.isLibrary ?? false)
app.promptAddToPlaylist()
}
},
"share": {
name: app.getLz('term.share'),
icon: "./assets/feather/share.svg",
@ -521,6 +604,7 @@
},
}
}
app.showMenuPanel(menuItems, event)
if (artistId != null) {
if (app.followingArtist(artistId)) {
@ -534,10 +618,22 @@
menuItems.items.follow.hidden = true
menuItems.items.unfollow.hidden = true
}
try {
let rating = await app.getRating(self.data)
if (rating == 0) {
menuItems.headerItems.find(x => x.id == 'love').disabled = false
menuItems.headerItems.find(x => x.id == 'dislike').disabled = false
} else if (rating == 1) {
menuItems.headerItems.find(x => x.id == 'unlove').hidden = false
menuItems.headerItems.find(x => x.id == 'love').hidden = true
} else if (rating == -1) {
menuItems.headerItems.find(x => x.id == 'undo_dislike').hidden = false
menuItems.headerItems.find(x => x.id == 'dislike').hidden = true
}
} catch (err) {
}
app.showMenuPanel(menuItems, event)
},
getItemParent: function (data) {
kind = data.attributes.playParams.kind;

View file

@ -151,12 +151,14 @@
</div>
</div>
</div>
<div class="playlist-body">
<div class="well">
<div class="playlist-body scrollbody">
<b-tabs pills align="center" content-class="mt-3">
<b-tab title="Tracks">
<div class="">
<div style="width:100%">
<draggable :sort="data.attributes.canEdit && data.type == 'library-playlists'"
v-model="data.relationships.tracks.data" @start="drag=true"
@end="drag=false;put()">
v-model="data.relationships.tracks.data" @start="drag=true" @end="drag=false;put()">
<template v-if="nestedPlaylist == [] || nestedPlaylist.length <= 1">
<mediaitem-list-item :item="item" :parent="getItemParent(data)" :index="index"
:showIndex="true"
@ -183,8 +185,7 @@
<div class="friends-info" v-if="itemBadges.length != 0">
<div class="well">
<div class="badge-container">
<div class="socialBadge"
:title="`${badge.attributes.name} - @${badge.attributes.handle}`"
<div class="socialBadge" :title="`${badge.attributes.name} - @${badge.attributes.handle}`"
v-for="badge in itemBadges">
<mediaitem-artwork
:url="badge.attributes.artwork.url"
@ -209,20 +210,26 @@
</div>
</template>
<hr>
<template v-if="typeof data.meta != 'undefined'">
<div v-for="view in data.meta.views.order" v-if="data.views[view].data.length != 0">
</b-tab>
<template v-if="typeof data.views != 'undefined'">
<b-tab lazy :title="data.views[view].attributes.title" v-for="view in data.meta.views.order" v-if="data.views[view].data.length != 0">
<div>
<div class="row">
<div class="col">
<h3>{{ data.views[view].attributes.title }}</h3>
</div>
</div>
<div>
<div class="row">
<div class="col">
<mediaitem-scroller-horizontal
:items="data.views[view].data"></mediaitem-scroller-horizontal>
</div>
</div>
</div>
</b-tab>
</template>
</b-tabs>
</div>
</template>
</div>

View file

@ -981,7 +981,7 @@
{{$root.getLz('settings.option.experimental.inline_playlists')}}
</div>
<div class="md-option-segment md-option-segment_auto">
<input type="checkbox" v-model="app.cfg.advanced.experiments.includes('inline-playlists')" @click="app.cfg.advanced.experiments.includes('inline-playlists') ? removeExperiment('inline-playlists') : addExperiment('inline-playlists')" switch/>
<input type="checkbox" disabled v-model="app.cfg.advanced.experiments.includes('inline-playlists')" @click="app.cfg.advanced.experiments.includes('inline-playlists') ? removeExperiment('inline-playlists') : addExperiment('inline-playlists')" switch/>
</div>
</div>
@ -1044,8 +1044,8 @@
<div class="md-option-header">
<span>{{$root.getLz('settings.header.connect')}}</span>
</div>
<div class="settings-option-body">
<div class="md-option-line update-check">
<div class="settings-option-body-webview">
<div class="md-option-line update-check" v-if="app.cfg.connectUser == null">
<div class="md-option-segment">
{{$root.getLz('settings.option.connect.link_account')}}
<small>{{$root.getLz('settings.option.connect.link_account.description')}}</small>
@ -1058,6 +1058,8 @@
</button>
</div>
</div>
<div v-if="app.cfg.connectUser != null" style="display:inline-flex; width:100%;height: 100%">
<iframe :src="`https://connect.cidercollective.dev/setSession/` + encodeURI(JSON.stringify(app.cfg.connectUser))" sandbox="allow-scripts allow-top-navigation allow-same-origin" width="100%" height="100%" frameborder="0"></iframe>
</div>
</div>
</div>