Merge branch 'ciderapp:develop' into develop

This commit is contained in:
Gabriel Davila 2022-04-30 19:04:33 -03:00 committed by GitHub
commit 54eb414285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 258 additions and 104 deletions

View file

@ -1,18 +1,21 @@
version: 2.1 version: 2.1
orbs: # adds orbs to your configuration
jira: circleci/jira@1.0.5 # invokes the Jira orb, making its commands accessible executors:
branches: cider-ci:
only:
- main
- develop
jobs:
build:
working_directory: ~/Cider
docker: docker:
- image: circleci/node:16 - image: circleci/node:16
working_directory: ~/Cider
orbs: # adds orbs to your configuration
jira: circleci/jira@1.0.5 # invokes the Jira orb, making its commands accessible
# The jobs for this project
jobs:
prepare-build:
executor: cider-ci
steps: steps:
- checkout - checkout
- run: ls -la
- run: - run:
name: Set App Version name: Set App Version
command: echo "export APP_VERSION=$(grep '"version":.*' package.json | cut -d '"' -f 4 | head -1)" >> $BASH_ENV command: echo "export APP_VERSION=$(grep '"version":.*' package.json | cut -d '"' -f 4 | head -1)" >> $BASH_ENV
@ -32,37 +35,111 @@ jobs:
paths: paths:
- ~/.cache/yarn - ~/.cache/yarn
- run: - run:
name: Install system build dependencies name: TypeScript Compile
command: yarn build
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory on the container which is
# taken to be the root directory of the workspace.
root: .
# Must be relative path from root
paths:
- node_modules
- build
- resources
- yarn.lock
- package.json
- winget.json # winget.json is a file that is generated by the winget package manager
- LICENSE
- license.txt
build-windows:
executor: cider-ci
steps:
- attach_workspace:
at: ~/Cider
- run:
name: Install Windows System Build Dependencies
command: | command: |
sudo apt-get update -y sudo apt-get update -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get install -y dpkg fakeroot wine64 sudo apt-get install -y dpkg fakeroot wine64
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y wine32 sudo apt-get install -y wine32
sudo apt install -y gh
- run: - run:
name: Fix Versioning and Add Channel name: Fix Versioning and Add Channel
command: yarn circle:script command: yarn circle:script
- run:
name: TypeScript Compile
command: yarn build
- run:
name: Generate Builds (Linux)
command: yarn electron-builder -l -p never
post-steps:
- jira/notify
- run: - run:
name: Generate Builds (Windows) name: Generate Builds (Windows)
command: yarn electron-builder -w --x64 -p never command: yarn electron-builder -w --x64 -p never
post-steps: post-steps:
- jira/notify - jira/notify
- persist_to_workspace:
root: .
paths:
- dist/*.exe
- dist/latest.yml
build-linux:
executor: cider-ci
steps:
- attach_workspace:
at: ~/Cider
- run:
name: Fix Versioning and Add Channel
command: yarn circle:script
- run:
name: Generate Builds (Linux)
command: yarn electron-builder -l -p never
post-steps:
- jira/notify
- persist_to_workspace:
root: .
paths:
- dist/*.deb
- dist/*.AppImage
- dist/*.snap
- dist/latest-linux.yml
build-winget:
executor: cider-ci
steps:
- attach_workspace:
at: ~/Cider
- run:
name: Install Windows System Build Dependencies
command: |
sudo apt-get update -y
sudo apt-get install -y dpkg fakeroot wine64
sudo dpkg --add-architecture i386
sudo apt-get update -y
sudo apt-get install -y wine32
- run:
name: Fix Versioning and Add Channel
command: yarn circle:script
- run: - run:
name: Generate Builds (Winget) name: Generate Builds (Winget)
command: yarn electron-builder --win -c winget.json -p never command: yarn electron-builder --win -c winget.json -p never
post-steps: post-steps:
- jira/notify - jira/notify
- persist_to_workspace:
root: .
paths:
- dist/*.exe
# - dist/*.yml
release:
executor: cider-ci
steps:
- attach_workspace:
at: ~/Cider/
- run:
name: Installing GitHub Command Line Interface
command: |
sudo apt-get update -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get update -y
sudo apt install -y gh
- run: - run:
name: Move Build Files name: Move Build Files
command: | command: |
@ -79,3 +156,23 @@ jobs:
name: Publish Release name: Publish Release
command: | command: |
gh release create "v${APP_VERSION}.${CIRCLE_BUILD_NUM}" --title "Cider Version ${APP_VERSION} - Build ${CIRCLE_BUILD_NUM} (${CIRCLE_BRANCH})" --generate-notes -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap gh release create "v${APP_VERSION}.${CIRCLE_BUILD_NUM}" --title "Cider Version ${APP_VERSION} - Build ${CIRCLE_BUILD_NUM} (${CIRCLE_BRANCH})" --generate-notes -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
# Orchestrate our job run sequence
workflows:
build_and_release:
jobs:
- prepare-build
- build-windows:
requires:
- prepare-build
- build-linux:
requires:
- prepare-build
- build-winget:
requires:
- prepare-build
- release:
requires:
- build-windows
- build-linux
- build-winget

View file

@ -73,7 +73,6 @@
"term.viewAs": "Megjelenítés", "term.viewAs": "Megjelenítés",
"term.viewAs.coverArt": "Borító", "term.viewAs.coverArt": "Borító",
"term.viewAs.list": "Lista", "term.viewAs.list": "Lista",
"term.dynamic": "Dinamikus",
"term.size": "Méret", "term.size": "Méret",
"term.size.normal": "Normál", "term.size.normal": "Normál",
"term.size.compact": "Kompakt", "term.size.compact": "Kompakt",
@ -407,6 +406,7 @@
"settings.option.lyrics.enableMusixmatchKaraoke": "Karaoke mód bekapcsolása (Csak MusixMatch)", "settings.option.lyrics.enableMusixmatchKaraoke": "Karaoke mód bekapcsolása (Csak MusixMatch)",
"settings.option.lyrics.musixmatchPreferredLanguage": "MusixMatch fordítás nyelve", "settings.option.lyrics.musixmatchPreferredLanguage": "MusixMatch fordítás nyelve",
"settings.option.lyrics.enableYoutubeLyrics": "YouTube dalszövegek engedélyezése a zenei videóknál", "settings.option.lyrics.enableYoutubeLyrics": "YouTube dalszövegek engedélyezése a zenei videóknál",
"settings.option.lyrics.enableQQLyrics": "QQLyrics dalszövegek engedélyezése",
"settings.header.connectivity": "Csatlakozások", "settings.header.connectivity": "Csatlakozások",
"settings.header.connectivity.description": "A Cider csatlakozás beállításainak módosítása.", "settings.header.connectivity.description": "A Cider csatlakozás beállításainak módosítása.",
"settings.option.connectivity.playbackNotifications": "Lejátszási értesítések", "settings.option.connectivity.playbackNotifications": "Lejátszási értesítések",

View file

@ -215,6 +215,10 @@
"settings.option.general.resumebehavior.locally.description": "Cider 將還原你在這台電腦上的最後一次操作。", "settings.option.general.resumebehavior.locally.description": "Cider 將還原你在這台電腦上的最後一次操作。",
"settings.option.general.resumebehavior.history": "歷史", "settings.option.general.resumebehavior.history": "歷史",
"settings.option.general.resumebehavior.history.description": "Cider 將跨裝置將你的整個 Apple Music 歷史記錄中的最後一首歌曲排隊入列。", "settings.option.general.resumebehavior.history.description": "Cider 將跨裝置將你的整個 Apple Music 歷史記錄中的最後一首歌曲排隊入列。",
"settings.option.general.resumetabs": "啟動時打開的選項",
"settings.option.general.resumetabs.description": "你可以選擇啟動 Cider 時要預設打開的左側選項欄。",
"settings.option.general.resumetabs.dynamic": "動態",
"settings.option.general.resumetabs.dynamic.description": "Cider 將打開你上次停留的左側選項欄。",
"settings.option.general.language.main": "語言", "settings.option.general.language.main": "語言",
"settings.option.general.language.fun": "特殊語言", "settings.option.general.language.fun": "特殊語言",
"settings.option.general.language.unsorted": "未分類", "settings.option.general.language.unsorted": "未分類",
@ -345,8 +349,8 @@
"settings.option.connectivity.discordRPC.hideButtons": "隱藏 Discord 動態上的按鈕", "settings.option.connectivity.discordRPC.hideButtons": "隱藏 Discord 動態上的按鈕",
"settings.option.connectivity.discordRPC.detailsFormat": "詳細資訊格式", "settings.option.connectivity.discordRPC.detailsFormat": "詳細資訊格式",
"settings.option.connectivity.discordRPC.stateFormat": "狀態格式", "settings.option.connectivity.discordRPC.stateFormat": "狀態格式",
"settings.option.connectivity.lastfmScrobble": "Last.FM Scrobbling 記錄", "settings.option.connectivity.lastfmScrobble": "Last.FM 音樂記錄",
"settings.option.connectivity.lastfmScrobble.delay": "Last.FM Scrobble 延遲 (%)", "settings.option.connectivity.lastfmScrobble.delay": "Last.FM 歌曲追蹤延遲 (%)",
"settings.option.connectivity.lastfmScrobble.nowPlaying": "開啟 Last.FM 正在聆聽", "settings.option.connectivity.lastfmScrobble.nowPlaying": "開啟 Last.FM 正在聆聽",
"settings.option.connectivity.lastfmScrobble.removeFeatured": "從歌名中移除客串藝人 (Last.FM)", "settings.option.connectivity.lastfmScrobble.removeFeatured": "從歌名中移除客串藝人 (Last.FM)",
"settings.option.connectivity.lastfmScrobble.filterLoop": "不記錄單曲循環 (Last.FM)", "settings.option.connectivity.lastfmScrobble.filterLoop": "不記錄單曲循環 (Last.FM)",

View file

@ -26,9 +26,9 @@ export class Plugins {
} }
public static getPluginFromMap(plugin: string): any { public static getPluginFromMap(plugin: string): any {
if(Plugins.PluginMap[plugin]) { if (Plugins.PluginMap[plugin]) {
return Plugins.PluginMap[plugin]; return Plugins.PluginMap[plugin];
}else{ } else {
return plugin; return plugin;
} }
} }

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-heart"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>

After

Width:  |  Height:  |  Size: 379 B

View file

@ -105,7 +105,7 @@ function fallbackinitMusicKit() {
}) })
setTimeout(() => { setTimeout(() => {
app.init() app.init()
if(app.cfg.visual.window_background_style == "mica" && !app.isDev) { if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
app.spawnMica() app.spawnMica()
} }
}, 1000) }, 1000)
@ -134,7 +134,7 @@ document.addEventListener('musickitloaded', function () {
function waitForApp() { function waitForApp() {
if (typeof app.init !== "undefined") { if (typeof app.init !== "undefined") {
app.init() app.init()
if(app.cfg.visual.window_background_style == "mica" && !app.isDev) { if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
app.spawnMica() app.spawnMica()
} }
} }

View file

@ -371,6 +371,12 @@
filter: contrast(0); filter: contrast(0);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.heart-icon {
height: 18px;
width: 39px;
filter: contrast(0);
background-repeat: no-repeat;
}
@keyframes load-bar { @keyframes load-bar {
10% { 10% {
box-shadow: inset 0 -4px 0; box-shadow: inset 0 -4px 0;

View file

@ -456,6 +456,13 @@
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.heart-icon {
height: 18px;
width: 39px;
filter: contrast(0);
background-repeat: no-repeat;
}
/* CSS.gg /* CSS.gg
*/ */
@keyframes load-bar { @keyframes load-bar {

View file

@ -22,7 +22,7 @@ const Events = {
if (event.keyCode === 82 && event.ctrlKey) { if (event.keyCode === 82 && event.ctrlKey) {
event.preventDefault() event.preventDefault()
bootbox.confirm("Reload Cider?", (res)=>{ bootbox.confirm("Reload Cider?", (res)=>{
if(res) { if (res) {
window.location.reload() window.location.reload()
} }
}) })

View file

@ -251,9 +251,9 @@ function simulateGamepad () {
cursorPos[1] -= cursorSpeed cursorPos[1] -= cursorSpeed
// sounds.Hover.play() // sounds.Hover.play()
// if(intTabIndex <= 0) { // if (intTabIndex <= 0) {
// intTabIndex = 0 // intTabIndex = 0
// }else{ // } else {
// intTabIndex-- // intTabIndex--
// } // }
// $(tabbable[intTabIndex]).focus() // $(tabbable[intTabIndex]).focus()
@ -263,9 +263,9 @@ function simulateGamepad () {
e.preventDefault() e.preventDefault()
cursorPos[1] += cursorSpeed cursorPos[1] += cursorSpeed
// if(intTabIndex < tabbable.length) { // if (intTabIndex < tabbable.length) {
// intTabIndex++ // intTabIndex++
// }else{ // } else {
// intTabIndex = tabbable.length // intTabIndex = tabbable.length
// } // }
// $(tabbable[intTabIndex]).focus() // $(tabbable[intTabIndex]).focus()

View file

@ -1579,7 +1579,7 @@ const app = new Vue({
} }
route = route.replace(/#/g, "") route = route.replace(/#/g, "")
if (app.cfg.general.resumeTabs.tab == "dynamic") { if (app.cfg.general.resumeTabs.tab == "dynamic") {
if (route == "home" || route == "library-songs" || route == "library-albums" || route == "library-artists" || route == "library-videos" || route == "podcasts") { if (route == "home" || route == "listen_now" || route == "browse" || route == "radio" || route == "library-songs" || route == "library-albums" || route == "library-artists" || route == "library-videos" || route == "podcasts") {
app.cfg.general.resumeTabs.dynamicData = route app.cfg.general.resumeTabs.dynamicData = route
} else { } else {
app.cfg.general.resumeTabs.dynamicData = "home" app.cfg.general.resumeTabs.dynamicData = "home"
@ -1671,11 +1671,11 @@ const app = new Vue({
params["meta[albums:tracks]"] = 'popularity' params["meta[albums:tracks]"] = 'popularity'
params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialNotes,editorialVideo,name,playParams,releaseDate,url,copyright" params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialNotes,editorialVideo,name,playParams,releaseDate,url,copyright"
} }
if(kind.includes("playlist") || kind.includes("album")){ if (kind.includes("playlist") || kind.includes("album")){
app.page = (kind) + "_" + (id); app.page = (kind) + "_" + (id);
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}` window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
app.getTypeFromID((kind), (id), (isLibrary), params); app.getTypeFromID((kind), (id), (isLibrary), params);
}else{ } else {
app.page = (kind) app.page = (kind)
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}` window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
} }
@ -2817,7 +2817,7 @@ const app = new Vue({
}); });
app.lyrics = preLrc; app.lyrics = preLrc;
} }
if (lrcfile != null && lrcfile != '' && lang != "disabled") { if (lrcfile != null && lrcfile != '') {
// load translation // load translation
getMXMTrans(id, lang, token); getMXMTrans(id, lang, token);
} else { } else {

View file

@ -108,11 +108,11 @@ const wsapi = {
app.mk.isPlaying ? app.mk.pause() : app.mk.play() app.mk.isPlaying ? app.mk.pause() : app.mk.play()
}, },
toggleRepeat() { toggleRepeat() {
if(MusicKit.getInstance().repeatMode == 0) { if (MusicKit.getInstance().repeatMode == 0) {
MusicKit.getInstance().repeatMode = 1 MusicKit.getInstance().repeatMode = 1
}else if(MusicKit.getInstance().repeatMode == 1){ } else if (MusicKit.getInstance().repeatMode == 1){
MusicKit.getInstance().repeatMode = 2 MusicKit.getInstance().repeatMode = 2
}else{ } else {
MusicKit.getInstance().repeatMode = 0 MusicKit.getInstance().repeatMode = 0
} }
}, },

View file

@ -7936,6 +7936,12 @@ fieldset:disabled .btn {
filter: contrast(0); filter: contrast(0);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.cd-mediaitem-list-item .heart-icon {
height: 18px;
width: 39px;
filter: contrast(0);
background-repeat: no-repeat;
}
@keyframes load-bar { @keyframes load-bar {
10% { 10% {
box-shadow: inset 0 -4px 0; box-shadow: inset 0 -4px 0;

View file

@ -1207,6 +1207,14 @@ body[platform="darwin"] .app-chrome .app-chrome-item > .window-controls > div.cl
background-repeat: no-repeat; background-repeat: no-repeat;
margin-left: 3px; margin-left: 3px;
} }
.heart-icon {
height: 9px;
width: 13px;
filter: contrast(0);
background-repeat: no-repeat;
margin-left: 3px;
}
} }
.lossless-icon { .lossless-icon {

View file

@ -133,11 +133,11 @@ app.mkapi("artists", false, "412778295", {
var library = [] var library = []
var downloaded = null; var downloaded = null;
function downloadChunk () { function downloadChunk () {
if(downloaded == null) { if (downloaded == null) {
app.mk.api.library.songs("", {limit: 100}, {includeResponseMeta: !0}).then((response)=>{ app.mk.api.library.songs("", {limit: 100}, {includeResponseMeta: !0}).then((response)=>{
processChunk(response) processChunk(response)
}) })
}else{ } else {
downloaded.next("", {limit: 100}, {includeResponseMeta: !0}).then((response)=>{ downloaded.next("", {limit: 100}, {includeResponseMeta: !0}).then((response)=>{
processChunk(response) processChunk(response)
}) })

View file

@ -29,7 +29,7 @@
template: '#artist-chip', template: '#artist-chip',
async mounted() { async mounted() {
let artistId = this.item.id let artistId = this.item.id
if(typeof this.item.relationships == "object") { if (typeof this.item.relationships == "object") {
artistId = this.item.relationships.catalog.data[0].id artistId = this.item.relationships.catalog.data[0].id
} }
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artistId}`).then(response => { app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artistId}`).then(response => {

View file

@ -54,7 +54,7 @@
app.modals.audioSettings = false app.modals.audioSettings = false
}, },
openSpatialAudio() { openSpatialAudio() {
if(app.cfg.audio.spatial === true && app.cfg.audio.maikiwiAudio.spatial === false) { if (app.cfg.audio.spatial === true && app.cfg.audio.maikiwiAudio.spatial === false) {
app.modals.spatialProperties = true app.modals.spatialProperties = true
app.modals.audioSettings = false app.modals.audioSettings = false
} else { } else {

View file

@ -115,7 +115,7 @@
}, },
methods: { methods: {
seekTo(startTime) { seekTo(startTime) {
if(startTime != 9999999) this.app.seekTo(startTime, false); if (startTime != 9999999) this.app.seekTo(startTime, false);
}, },
getActiveLyric() { getActiveLyric() {
const delayfix = 0.1 const delayfix = 0.1
@ -125,7 +125,7 @@
if (app.currentLyricsLine != i) { if (app.currentLyricsLine != i) {
app.currentLyricsLine = i; app.currentLyricsLine = i;
if (((app.lyricon && app.drawer.open) || app.appMode == 'fullscreen') && this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`)) { if (((app.lyricon && app.drawer.open) || app.appMode == 'fullscreen') && this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`)) {
if(this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${prevLine}"]`)) {this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${prevLine}"]`).classList.remove("active");} if (this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${prevLine}"]`)) {this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${prevLine}"]`).classList.remove("active");}
this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`).classList.add("active") this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`).classList.add("active")
if (this.checkIfScrollIsStatic) { if (this.checkIfScrollIsStatic) {
let lyricElement = this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`) let lyricElement = this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`)

View file

@ -76,9 +76,9 @@
}, event) }, event)
}, },
getVideoPriority() { getVideoPriority() {
if(app.cfg.visual.animated_artwork == "always") { if (app.cfg.visual.animated_artwork == "always") {
return true; return true;
}else if (this.videoPriority && app.cfg.visual.animated_artwork == "limited") { } else if (this.videoPriority && app.cfg.visual.animated_artwork == "limited") {
return true return true
} else if (app.cfg.visual.animated_artwork == "disabled") { } else if (app.cfg.visual.animated_artwork == "disabled") {
return false return false

View file

@ -65,6 +65,9 @@
</template> </template>
</div> </div>
</div> </div>
<div class="heart-icon" v-if="isLoved">
<div class="svg-icon" :style="{'--url': 'url(./assets/feather/heart-fill.svg)'}"></div>
</div>
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'"></div> <div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'"></div>
<template v-if="showMetaData == true" @dblclick="route()"> <template v-if="showMetaData == true" @dblclick="route()">
<div class="metainfo"> <div class="metainfo">
@ -98,7 +101,8 @@
displayDuration: true, displayDuration: true,
addClasses: {}, addClasses: {},
itemId: 0, itemId: 0,
isLibrary: false isLibrary: false,
isLoved: null
} }
}, },
props: { props: {
@ -121,6 +125,9 @@
} else { } else {
this.itemId = this.item.id; this.itemId = this.item.id;
} }
if (this.item.attributes.playParams) {
this.getHeartStatus();
}
let duration = this.item.attributes.durationInMillis ?? 0 let duration = this.item.attributes.durationInMillis ?? 0
if (duration == 0 || !this.showDuration) { if (duration == 0 || !this.showDuration) {
this.displayDuration = false this.displayDuration = false
@ -145,7 +152,7 @@
}, },
getClasses() { getClasses() {
this.addClasses = {} this.addClasses = {}
if(typeof this.item.attributes.playParams == "undefined") { if (typeof this.item.attributes.playParams == "undefined") {
this.addClasses["disabled"] = true this.addClasses["disabled"] = true
} }
if (this.classList) { if (this.classList) {
@ -178,7 +185,7 @@
} else { } else {
return this.item.attributes.playParams.kind return this.item.attributes.playParams.kind
} }
}else{ } else {
return this.item.type return this.item.type
} }
}, },
@ -323,6 +330,7 @@
"hidden": false, "hidden": false,
"disabled": true, "disabled": true,
"action": function () { "action": function () {
self.isLoved = true
app.love(self.item) app.love(self.item)
} }
}, },
@ -333,6 +341,7 @@
"name": this.app.getLz('action.unlove'), "name": this.app.getLz('action.unlove'),
"hidden": true, "hidden": true,
"action": function () { "action": function () {
self.isLoved = false
app.unlove(self.item) app.unlove(self.item)
} }
}, },
@ -499,6 +508,19 @@
visibilityChanged: function (isVisible, entry) { visibilityChanged: function (isVisible, entry) {
this.isVisible = isVisible this.isVisible = isVisible
}, },
async getHeartStatus() {
try {
await app.getRating(this.item).then(res => {
if (res == 1) {
this.isLoved = true
} else {
this.isLoved = false
}
})
} catch (err) {
console.log(err)
}
},
addToLibrary() { addToLibrary() {
let item = this.item let item = this.item
if (item.attributes.playParams.id) { if (item.attributes.playParams.id) {

View file

@ -27,7 +27,7 @@
<div class="title text-overflow-elipsis" @click='app.routeView(item)'> <div class="title text-overflow-elipsis" @click='app.routeView(item)'>
{{ item.attributes.name ?? '' }} {{ item.attributes.name ?? '' }}
</div> </div>
<div class="subtitle text-overflow-elipsis item-navigate" v-if="item.attributes.artistName" :style = "{'z-index': ((item.attributes.editorialNotes == null) && item.attributes.artistName) ? '4' : ''}" @click="if(item.attributes.artistName)app.searchAndNavigate(item,'artist')"> <div class="subtitle text-overflow-elipsis item-navigate" v-if="item.attributes.artistName" :style = "{'z-index': ((item.attributes.editorialNotes == null) && item.attributes.artistName) ? '4' : ''}" @click="if (item.attributes.artistName)app.searchAndNavigate(item,'artist')">
{{ item.attributes.artistName ?? '' }} {{ item.attributes.artistName ?? '' }}
</div> </div>

View file

@ -93,12 +93,12 @@
}, },
async mounted() { async mounted() {
await this.getBadges() await this.getBadges()
if(typeof this.item.attributes.playParams == "object") { if (typeof this.item.attributes.playParams == "object") {
if(this.item.attributes.playParams.kind.includes("radioStation") && (this.item.attributes.playParams.streamingKind == 1 || this.item.attributes.playParams.streamingKind == 2)) { if (this.item.attributes.playParams.kind.includes("radioStation") && (this.item.attributes.playParams.streamingKind == 1 || this.item.attributes.playParams.streamingKind == 2)) {
this.unavailable = true this.unavailable = true
} }
}else{ } else {
if(this.item.type == "music-movies" || this.item.type == "tv-episodes") { if (this.item.type == "music-movies" || this.item.type == "tv-episodes") {
this.unavailable = true this.unavailable = true
} }
} }
@ -116,7 +116,7 @@
} }
}, },
getSubtitle() { getSubtitle() {
if(this.kind == 'card') { if (this.kind == 'card') {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.artistNames != "undefined") {
return this.item.attributes.artistNames return this.item.attributes.artistNames
@ -130,7 +130,7 @@
}catch(e) { }catch(e) {
return '' return ''
} }
}else { } else {
if (typeof this.item.attributes.artistName != "undefined") { if (typeof this.item.attributes.artistName != "undefined") {
return this.item.attributes.artistName return this.item.attributes.artistName
} else { } else {
@ -139,7 +139,7 @@
} }
}, },
getSubtitleNavigation() { getSubtitleNavigation() {
if(this.kind == 'card') { if (this.kind == 'card') {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.artistNames != "undefined") {
return app.routeView(this.item) return app.routeView(this.item)
@ -153,7 +153,7 @@
}catch(e) { }catch(e) {
return app.routeView(this.item) return app.routeView(this.item)
} }
}else { } else {
if (typeof this.item.attributes.artistName != "undefined") { if (typeof this.item.attributes.artistName != "undefined") {
return app.searchAndNavigate(this.item,'artist') return app.searchAndNavigate(this.item,'artist')
} else { } else {
@ -224,7 +224,7 @@
}, },
getArtworkUrl(size = -1, includeUrl = false) { getArtworkUrl(size = -1, includeUrl = false) {
let artwork = this.item.attributes.artwork ? this.item.attributes.artwork.url : '' let artwork = this.item.attributes.artwork ? this.item.attributes.artwork.url : ''
if(size != -1) { if (size != -1) {
artwork = artwork.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', ((size === 900) ? "sr" : "cc")) artwork = artwork.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', ((size === 900) ? "sr" : "cc"))
} }
switch (this.kind) { switch (this.kind) {
@ -232,9 +232,9 @@
artwork = this.item.attributes.editorialArtwork?.subscriptionHero?.url ?? (this.item.attributes.artwork?.url ?? (this.item.relationships?.contents?.data[0]?.attributes?.editorialArtwork?.subscriptionHero?.url ?? '')) artwork = this.item.attributes.editorialArtwork?.subscriptionHero?.url ?? (this.item.attributes.artwork?.url ?? (this.item.relationships?.contents?.data[0]?.attributes?.editorialArtwork?.subscriptionHero?.url ?? ''))
break; break;
} }
if(!includeUrl) { if (!includeUrl) {
return artwork return artwork
}else{ } else {
return `url("${artwork}")` return `url("${artwork}")`
} }
}, },
@ -442,7 +442,7 @@
if (self.item.relationships.catalog){ if (self.item.relationships.catalog){
app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.copyToClipboard((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)}) app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.copyToClipboard((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)})
} }
}else { } else {
self.app.copyToClipboard(self.item.attributes.url)} self.app.copyToClipboard(self.item.attributes.url)}
} }
}, },
@ -454,7 +454,7 @@
if (self.item.relationships.catalog){ if (self.item.relationships.catalog){
app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.songLinkShare((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)}) app.mkapi(self.item.attributes.playParams.kind, false, self.item.relationships.catalog.data[0].id).then(u => {self.app.songLinkShare((u.data.data.length && u.data.data.length > 0)? u.data.data[0].attributes.url : u.data.data.attributes.url)})
} }
}else { } else {
self.app.songLinkShare(self.item.attributes.url)} self.app.songLinkShare(self.item.attributes.url)}
} }
} }
@ -471,10 +471,10 @@
try { try {
await this.isInLibrary().then((_) => { await this.isInLibrary().then((_) => {
if(self.addedToLibrary) { if (self.addedToLibrary) {
menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true
menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false
}else{ } else {
menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false
} }
}) })
@ -530,7 +530,7 @@
} }
} }
} }
if(self.app.cfg.home.followedArtists.includes(this.item.id)) { if (self.app.cfg.home.followedArtists.includes(this.item.id)) {
followAction = "unfollow" followAction = "unfollow"
} }
app.showMenuPanel({ app.showMenuPanel({

View file

@ -70,8 +70,8 @@
this.history = history.data.data this.history = history.data.data
}, },
select(e, position) { select(e, position) {
if(e.ctrlKey || e.shiftKey) { if (e.ctrlKey || e.shiftKey) {
if(this.selectedItems.indexOf(position) == -1) { if (this.selectedItems.indexOf(position) == -1) {
this.selectedItems.push(position) this.selectedItems.push(position)
} else { } else {
this.selectedItems.splice(this.selectedItems.indexOf(position), 1) this.selectedItems.splice(this.selectedItems.indexOf(position), 1)
@ -83,7 +83,7 @@
queueContext(event, item, position) { queueContext(event, item, position) {
let self = this let self = this
let useMenu = "single" let useMenu = "single"
if(this.selectedItems.length > 1) { if (this.selectedItems.length > 1) {
useMenu = "multiple" useMenu = "multiple"
} }
let menus = { let menus = {

View file

@ -63,7 +63,7 @@
}, },
methods: { methods: {
playlistSelect(playlist) { playlistSelect(playlist) {
if(playlist.type != "library-playlist-folders") { if (playlist.type != "library-playlist-folders") {
this.addToPlaylist(playlist.id) this.addToPlaylist(playlist.id)
} }
}, },

View file

@ -294,7 +294,7 @@
this.room_materials = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.room_materials)) this.room_materials = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.room_materials))
this.audio_position = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.audio_position)) this.audio_position = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.audio_position))
this.listener_position = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.listener_position)) this.listener_position = JSON.parse(JSON.stringify(this.$root.cfg.audio.spatial_properties.listener_position))
if(typeof this.app.mk.nowPlayingItem != "undefined") { if (typeof this.app.mk.nowPlayingItem != "undefined") {
this.setRoom() this.setRoom()
} }
this.ready = true this.ready = true
@ -320,7 +320,7 @@
}, },
objectContainerStyle() { objectContainerStyle() {
let scale = 1 let scale = 1
if(this.room_dimensions.width * this.visualMultiplier > 300) { if (this.room_dimensions.width * this.visualMultiplier > 300) {
scale = 300 / (this.room_dimensions.width * this.visualMultiplier) scale = 300 / (this.room_dimensions.width * this.visualMultiplier)
} }
let style = { let style = {
@ -346,7 +346,7 @@
window.CiderAudio.audioNodes.spatialNode.setRoomProperties(this.room_dimensions, this.room_materials); window.CiderAudio.audioNodes.spatialNode.setRoomProperties(this.room_dimensions, this.room_materials);
CiderAudio.audioNodes.spatialInput.setPosition(...this.audio_position) CiderAudio.audioNodes.spatialInput.setPosition(...this.audio_position)
CiderAudio.audioNodes.spatialNode.setListenerPosition(...this.listener_position) CiderAudio.audioNodes.spatialNode.setListenerPosition(...this.listener_position)
if(!this.app.cfg.audio.normalization) { if (!this.app.cfg.audio.normalization) {
window.CiderAudio.audioNodes.gainNode.gain.value = app.cfg.audio.spatial_properties.gain window.CiderAudio.audioNodes.gainNode.gain.value = app.cfg.audio.spatial_properties.gain
} }
} }

View file

@ -172,7 +172,7 @@
} }
} }
} }
if(this.app.cfg.home.followedArtists.includes(self.data.id)) { if (this.app.cfg.home.followedArtists.includes(self.data.id)) {
followAction = "unfollow" followAction = "unfollow"
} }
app.showMenuPanel({ app.showMenuPanel({

View file

@ -132,9 +132,9 @@
self.themes = [] self.themes = []
notyf.success(app.getLz('settings.notyf.visual.plugin.install.success')); notyf.success(app.getLz('settings.notyf.visual.plugin.install.success'));
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{ bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if(ok) { if (ok) {
ipcRenderer.invoke("relaunchApp") ipcRenderer.invoke("relaunchApp")
}else{ } else {
return return
} }
}) })
@ -154,9 +154,9 @@
if (arg.success) { if (arg.success) {
self.themes = ipcRenderer.sendSync("get-themes") self.themes = ipcRenderer.sendSync("get-themes")
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{ bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
if(ok) { if (ok) {
ipcRenderer.invoke("relaunchApp") ipcRenderer.invoke("relaunchApp")
}else{ } else {
return return
} }
}) })

View file

@ -187,7 +187,7 @@
}, },
searchPodcasts() { searchPodcasts() {
let self = this let self = this
if(this.search.term == "") { if (this.search.term == "") {
return return
} }
app.mk.api.v3.podcasts("/v1/catalog/us/search", {term: this.search.term, types: ["podcasts"], limit: 25}).then(response => { app.mk.api.v3.podcasts("/v1/catalog/us/search", {term: this.search.term, types: ["podcasts"], limit: 25}).then(response => {
@ -227,7 +227,7 @@
async getNextEpisodes(next, podcastId) { async getNextEpisodes(next, podcastId) {
let podcastShow = await app.mk.api.v3.podcasts(next) let podcastShow = await app.mk.api.v3.podcasts(next)
if(podcastId != this.podcastSelected.id) { if (podcastId != this.podcastSelected.id) {
return return
} }
podcastShow.data.data.forEach(ep => { podcastShow.data.data.forEach(ep => {

View file

@ -90,6 +90,9 @@
<select class="md-select" style="width:180px;" <select class="md-select" style="width:180px;"
v-model="$root.cfg.general.resumeTabs.tab"> v-model="$root.cfg.general.resumeTabs.tab">
<option value="home">{{$root.getLz('home.title')}}</option> <option value="home">{{$root.getLz('home.title')}}</option>
<option value="listen_now">{{$root.getLz('term.listenNow')}}</option>
<option value="browse">{{$root.getLz('term.browse')}}</option>
<option value="radio">{{$root.getLz('term.radio')}}</option>
<option value="library-recentlyadded">{{$root.getLz('term.recentlyAdded')}}</option> <option value="library-recentlyadded">{{$root.getLz('term.recentlyAdded')}}</option>
<option value="library-songs">{{$root.getLz('term.songs')}}</option> <option value="library-songs">{{$root.getLz('term.songs')}}</option>
<option value="library-albums">{{$root.getLz('term.albums')}}</option> <option value="library-albums">{{$root.getLz('term.albums')}}</option>
@ -1539,7 +1542,7 @@
this.tabIndex = parseInt(window.location.hash.split("/")[1]) this.tabIndex = parseInt(window.location.hash.split("/")[1])
console.debug("tabIndex", this.tabIndex) console.debug("tabIndex", this.tabIndex)
this.canChangeHash = true this.canChangeHash = true
}else{ } else {
this.canChangeHash = true this.canChangeHash = true
} }
}) })

View file

@ -90,7 +90,7 @@
return "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg" return "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"
} }
height = parseInt(height * window.devicePixelRatio) height = parseInt(height * window.devicePixelRatio)
if(width) { if (width) {
width = parseInt(width * window.devicePixelRatio) width = parseInt(width * window.devicePixelRatio)
} }
let newurl = `${url.replace('{w}', width ?? height).replace('{h}', height).replace('{f}', "webp").replace('{c}', ((width === 900) ? "sr" : "cc"))}`; let newurl = `${url.replace('{w}', width ?? height).replace('{h}', height).replace('{f}', "webp").replace('{c}', ((width === 900) ? "sr" : "cc"))}`;

View file

@ -86,14 +86,14 @@
if (luma > 140) { if (luma > 140) {
return "#aaaaaa" return "#aaaaaa"
}else{ } else {
return color return color
} }
}, },
getSubtitle() { getSubtitle() {
if(this.kind == 'card') { if (this.kind == 'card') {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.artistNames != "undefined") {
return this.item.attributes.artistNames return this.item.attributes.artistNames
@ -107,7 +107,7 @@
}catch(e) { }catch(e) {
return '' return ''
} }
}else { } else {
if (typeof this.item.attributes.artistName != "undefined") { if (typeof this.item.attributes.artistName != "undefined") {
return this.item.attributes.artistName return this.item.attributes.artistName
} else { } else {
@ -116,7 +116,7 @@
} }
}, },
getSubtitleNavigation() { getSubtitleNavigation() {
if(this.kind == 'card') { if (this.kind == 'card') {
try { try {
if (typeof this.item.attributes.artistNames != "undefined") { if (typeof this.item.attributes.artistNames != "undefined") {
return app.routeView(this.item) return app.routeView(this.item)
@ -130,7 +130,7 @@
}catch(e) { }catch(e) {
return app.routeView(this.item) return app.routeView(this.item)
} }
}else { } else {
if (typeof this.item.attributes.artistName != "undefined") { if (typeof this.item.attributes.artistName != "undefined") {
return app.searchAndNavigate(this.item,'artist') return app.searchAndNavigate(this.item,'artist')
} else { } else {
@ -200,7 +200,7 @@
}, },
getArtworkUrl(size = -1, includeUrl = false) { getArtworkUrl(size = -1, includeUrl = false) {
let artwork = this.item.attributes.artwork ? this.item.attributes.artwork.url : '' let artwork = this.item.attributes.artwork ? this.item.attributes.artwork.url : ''
if(size != -1) { if (size != -1) {
artwork = artwork.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', ((size === 900) ? "sr" : "cc")) artwork = artwork.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', ((size === 900) ? "sr" : "cc"))
} }
switch (this.kind) { switch (this.kind) {
@ -208,9 +208,9 @@
artwork = this.item.attributes.editorialArtwork.subscriptionHero.url artwork = this.item.attributes.editorialArtwork.subscriptionHero.url
break; break;
} }
if(!includeUrl) { if (!includeUrl) {
return artwork return artwork
}else{ } else {
return `url("${artwork}")` return `url("${artwork}")`
} }
}, },
@ -423,10 +423,10 @@
try { try {
await this.isInLibrary().then((_) => { await this.isInLibrary().then((_) => {
if(self.addedToLibrary) { if (self.addedToLibrary) {
menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true
menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false
}else{ } else {
menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false
} }
}) })