Sync I don't commit now is the conflict of tomorrow (#477)

* Added update check if using MSS or MAS builds. need help implementing

* fix locale / allow pl to show before list loading is fully done

* oops

* Also copy blockmap for partial download

`[2022-02-15 17:28:30.126] [error] Cannot download differentially, fallback to full download: Error: Cannot download "https://478-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts/Cider-Setup-1.1.428.exe.blockmap", status 404: Not Found
    at ClientRequest.<anonymous> (C:\Program Files\Cider\resources\app.asar\node_modules\builder-util-runtime\src\httpExecutor.ts:288:11)
    at ClientRequest.emit (node:events:394:28)
    at ClientRequest.emit (node:domain:475:12)
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:105:6829)
    at SimpleURLLoaderWrapper.emit (node:events:394:28)
    at SimpleURLLoaderWrapper.emit (node:domain:475:12)`

* more lang fix

* Removed Discord clear on pause

* Linux frame

* fix #459

* Fix

* exposed --songProgressColor and --songProgressBackground

* revert

* Revert "revert"

This reverts commit 24313b53cf.

* ok?

* Revert "ok?"

This reverts commit 9218ccc887.

* ok

* fix adding/remove mvs from library

* Created audio controls menu

* Added start-renderer command for easier testing

* shitty floats shitty shitty

* LastFM can be unique and have its own call

* Revert "LastFM can be unique and have its own call"

This reverts commit d36e1b19f6.

* Revert "Merge branch 'develop' into develop"

This reverts commit 5fa345e6c8, reversing
changes made to a02b633f49.

* Revert "Revert "LastFM can be unique and have its own call""

This reverts commit f156083d48.

* Revert "Merge branch 'ciderapp:develop' into develop"

This reverts commit 20fd0c05da, reversing
changes made to 4937e29fcf.

* lastfm changes

* i hate lastfm

like really really
hate
it

* Revert "Merge remote-tracking branch 'origin/develop' into develop"

This reverts commit 5b360e74fa, reversing
changes made to 548688341d.

* Revert "Revert "Merge remote-tracking branch 'origin/develop' into develop""

This reverts commit 0fb6802ff3.

* Revert "Merge branch 'develop' of https://github.com/ciderapp/Cider into develop"

This reverts commit bd3a2b6172, reversing
changes made to 0fb6802ff3.

* volume step i18n

* and git can go in the bin too

* Added OpenAppData button in settings and updated layout/translations

* change in translation README.md

* margin: 0 on song-progress

* fix np navigation on some songs

* enables native linux chrome

* replay wip

* replay, added this year

* fix for library status

* added attributes.playparams.id

* replay banner

* changed colors

* fancy animations

* more fancy

* some changes

* add play button in library-songs page

* fix

* improve drag on topbar

* Generating top genres, made buttons nicer on replay

* changes to replay graphs

* Revert "Merge branch 'innolab' into develop"

This reverts commit b740f76e3c, reversing
changes made to a5746f08fa.

* added force-video to mediaitem-square

* Update zh_TW.jsonc (#468)

Update TW language.

Co-authored-by: Maikiwi <stella@mai.kiwi>

* Update zh_TW.jsonc

* frontend plugins first iteration

* trans prep

* macOS transparency

* fix playlist on listen now

* fix #474

* ok

* back button & media keys improvement

* ok

Co-authored-by: child_duckling <19170969+quacksire@users.noreply.github.com>
Co-authored-by: vapormusic <vietanhfat@gmail.com>
Co-authored-by: JYW0803 <74043061+JYW0803@users.noreply.github.com>
Co-authored-by: Core <64542347+coredev-uk@users.noreply.github.com>
Co-authored-by: booploops <49113086+booploops@users.noreply.github.com>
Co-authored-by: 宥叡 <46503943+jay900604@users.noreply.github.com>
This commit is contained in:
Maikiwi 2022-02-18 14:10:08 -08:00 committed by GitHub
parent 542d3a348c
commit c6fe53999f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 131 additions and 21 deletions

View file

@ -108,6 +108,7 @@
"term.fullscreenView": "全螢幕顯示", "term.fullscreenView": "全螢幕顯示",
"term.defaultView": "預設顯示", "term.defaultView": "預設顯示",
"term.audioSettings": "音訊設定", "term.audioSettings": "音訊設定",
"term.audioControls": "音訊控制",
"term.spacializedAudioSetting": "空間音訊設定", "term.spacializedAudioSetting": "空間音訊設定",
"term.clearAll": "清空", "term.clearAll": "清空",
"term.recentStations": "最近收聽的廣播", "term.recentStations": "最近收聽的廣播",
@ -209,6 +210,7 @@
"action.copy": "複製", "action.copy": "複製",
"action.newpreset": "新增預設", // Equalizer Preset "action.newpreset": "新增預設", // Equalizer Preset
"action.deletepreset": "刪除預設", // Equalizer Preset "action.deletepreset": "刪除預設", // Equalizer Preset
"action.open": "開啟",
// Settings - General // Settings - General
"settings.header.general": "一般", "settings.header.general": "一般",
@ -230,7 +232,7 @@
"settings.header.audio": "音訊", "settings.header.audio": "音訊",
"settings.header.audio.description": "調整 Cider 的音訊設定", "settings.header.audio.description": "調整 Cider 的音訊設定",
"settings.option.audio.volumeStep": "音量改變量", "settings.option.audio.volumeStep": "音量改變量",
"settings.option.audio.maxVolume": "最音量", "settings.option.audio.maxVolume": "最音量",
"settings.option.audio.quality": "音訊品質", // Dropdown "settings.option.audio.quality": "音訊品質", // Dropdown
"settings.header.audio.quality.hireslossless": "高品質無損壓縮", "settings.header.audio.quality.hireslossless": "高品質無損壓縮",
"settings.header.audio.quality.hireslossless.description": "(高達 24-bit/192 kHz", "settings.header.audio.quality.hireslossless.description": "(高達 24-bit/192 kHz",
@ -314,13 +316,17 @@
"settings.option.connectivity.lastfmScrobble.filterLoop": "不記錄單曲循環 (LastFM)", "settings.option.connectivity.lastfmScrobble.filterLoop": "不記錄單曲循環 (LastFM)",
// Refer to term.connect for the connect button // Refer to term.connect for the connect button
// Settings - Debug
"settings.header.debug": "除錯",
"settings.option.debug.copy_log": "複製執行紀錄檔至剪貼簿",
"settings.option.debug.openAppData": "打開 Cider 資料夾",
// Settings - Experimental // Settings - Experimental
"settings.header.experimental": "實驗性功能", "settings.header.experimental": "實驗性功能",
"settings.header.experimental.description": "調整 Cider 的實驗性功能", "settings.header.experimental.description": "調整 Cider 的實驗性功能",
"settings.option.experimental.compactUI": "使用緊密的介面設計", // Toggle "settings.option.experimental.compactUI": "使用緊密的介面設計", // Toggle
"settings.option.experimental.closeButtonBehaviour": "關閉按鈕操作", // Dropdown "settings.option.experimental.closeButtonBehaviour": "關閉按鈕操作", // Dropdown
"settings.option.experimental.close_button_hide": "關閉按鈕將 Cider 隱藏至系統列", "settings.option.experimental.close_button_hide": "關閉按鈕將 Cider 隱藏至系統列",
"settings.option.experimental.copy_log": "複製執行紀錄檔至剪貼簿",
"settings.option.experimental.inline_playlists": "將播放列表做為行内元素顯示", "settings.option.experimental.inline_playlists": "將播放列表做為行内元素顯示",
// Refer to term.disabled & term.enabled // Refer to term.disabled & term.enabled

View file

@ -91,14 +91,15 @@ export class BrowserWindow {
minHeight: 390, minHeight: 390,
frame: false, frame: false,
title: "Cider", title: "Cider",
vibrancy: "fullscreen-ui", vibrancy: "dark",
transparent: process.platform === "darwin", transparent: process.platform === "darwin",
hasShadow: false, hasShadow: true,
show: false, show: false,
backgroundColor: "#1E1E1E", // backgroundColor: "#1E1E1E",
titleBarStyle: 'hidden', titleBarStyle: 'hidden',
trafficLightPosition: {x: 15, y: 20}, trafficLightPosition: {x: 15, y: 20},
webPreferences: { webPreferences: {
experimentalFeatures: true,
nodeIntegration: true, nodeIntegration: true,
sandbox: true, sandbox: true,
allowRunningInsecureContent: true, allowRunningInsecureContent: true,
@ -129,8 +130,12 @@ export class BrowserWindow {
switch(process.platform) { switch(process.platform) {
default: default:
break;
case "win32":
this.options.backgroundColor = "#1E1E1E";
break; break;
case "linux": case "linux":
this.options.backgroundColor = "#1E1E1E";
this.options.autoHideMenuBar = true this.options.autoHideMenuBar = true
this.options.frame = true this.options.frame = true
break; break;

View file

@ -32,6 +32,7 @@ export class Plugins {
if (fs.existsSync(this.userPluginsPath)) { if (fs.existsSync(this.userPluginsPath)) {
fs.readdirSync(this.userPluginsPath).forEach(file => { fs.readdirSync(this.userPluginsPath).forEach(file => {
// Plugins V1
if (file.endsWith('.ts') || file.endsWith('.js')) { if (file.endsWith('.ts') || file.endsWith('.js')) {
if (!electron.app.isPackaged) { if (!electron.app.isPackaged) {
const plugin = require(path.join(this.userPluginsPath, file)).default; const plugin = require(path.join(this.userPluginsPath, file)).default;
@ -50,7 +51,24 @@ export class Plugins {
plugins[file] = new plugin(electron.app, utils.getStore()); plugins[file] = new plugin(electron.app, utils.getStore());
} }
} }
}
// Plugins V2
else if (fs.lstatSync(path.join(this.userPluginsPath, file)).isDirectory()) {
const pluginPath = path.join(this.userPluginsPath, file);
if (fs.existsSync(path.join(pluginPath, 'package.json'))) {
const plugin = require(path.join(pluginPath, "index.js"));
if (plugins[plugin.name] || plugin.name in plugins) {
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
} else {
const pluginEnv = {
app: electron.app,
store: utils.getStore(),
utils: utils,
dir: pluginPath
}
plugins[plugin.name] = new plugin(pluginEnv);
}
}
} }
}); });
} }

View file

@ -183,6 +183,9 @@ export class wsapi {
break; break;
case "next": case "next":
this._win.webContents.executeJavaScript(`if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1 && MusicKit.getInstance().queue.nextPlayableItemIndex != null) { this._win.webContents.executeJavaScript(`if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1 && MusicKit.getInstance().queue.nextPlayableItemIndex != null) {
try {
app.prevButtonBackIndicator = false;
} catch (e) { }
MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex);}`); MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex);}`);
response.message = "Next"; response.message = "Next";
break; break;

View file

@ -136,6 +136,9 @@ const MusicKitInterop = {
}, },
next: () => { next: () => {
try {
app.prevButtonBackIndicator = false;
} catch (e) { }
if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1 && MusicKit.getInstance().queue.nextPlayableItemIndex != null) if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1 && MusicKit.getInstance().queue.nextPlayableItemIndex != null)
MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex); MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex);
// MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`)); // MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`));

View file

@ -250,7 +250,8 @@ const app = new Vue({
items: {}, items: {},
headerItems: {} headerItems: {}
} }
} },
pauseButtonTimer : null
}, },
watch: { watch: {
cfg: { cfg: {
@ -452,7 +453,7 @@ const app = new Vue({
history.forward() history.forward()
}, },
getHTMLStyle() { getHTMLStyle() {
document.querySelector("html").style.background = "#222"; // document.querySelector("html").style.background = "#222";
document.querySelector("body").classList.add("notransparency") document.querySelector("body").classList.add("notransparency")
}, },
resetState() { resetState() {
@ -813,6 +814,8 @@ const app = new Vue({
this.page = "home" this.page = "home"
} }
this.mediaKeyFixes()
setTimeout(() => { setTimeout(() => {
this.getSocialBadges() this.getSocialBadges()
this.getBrowsePage(); this.getBrowsePage();
@ -1319,6 +1322,14 @@ const app = new Vue({
extend: "offers,editorialVideo", extend: "offers,editorialVideo",
"views": "appears-on,more-by-artist,related-videos,other-versions,you-might-also-like,video-extras,audio-extras", "views": "appears-on,more-by-artist,related-videos,other-versions,you-might-also-like,video-extras,audio-extras",
} }
if (kind.includes("playlist")){
params["include"] = "tracks";
}
if (kind.includes("album")){
params["include[albums]"] = "artists"
params["fields[artists]"] = "name,url"
params["fields[albums]"] = "artistName,artistUrl,artwork,contentRating,editorialArtwork,name,playParams,releaseDate,url"
}
if (this.cfg.advanced.experiments.includes('inline-playlists')) { if (this.cfg.advanced.experiments.includes('inline-playlists')) {
let showModal = kind.toString().includes("album") || kind.toString().includes("playlist") let showModal = kind.toString().includes("album") || kind.toString().includes("playlist")
@ -1347,8 +1358,11 @@ const app = new Vue({
prevButton() { prevButton() {
if (!app.prevButtonBackIndicator && app.mk.nowPlayingItem && app.mk.currentPlaybackTime > 2) { if (!app.prevButtonBackIndicator && app.mk.nowPlayingItem && app.mk.currentPlaybackTime > 2) {
app.prevButtonBackIndicator = true; app.prevButtonBackIndicator = true;
try{clearTimeout(app.pauseButtonTimer)} catch (e){ }
app.mk.seekToTime(0); app.mk.seekToTime(0);
app.pauseButtonTimer = setTimeout(() => {app.prevButtonBackIndicator = false},3000);
} else { } else {
try{clearTimeout(app.pauseButtonTimer)} catch (e){ }
app.prevButtonBackIndicator = false; app.prevButtonBackIndicator = false;
app.skipToPreviousItem() app.skipToPreviousItem()
} }
@ -3245,8 +3259,8 @@ const app = new Vue({
}, },
async getRating(item) { async getRating(item) {
let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let type = item.type.slice(-1) === "s" ? item.type : item.type + "s"
let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id)
if (item.id.startsWith("i.")) { if (item.id != null && (item.id.toString()).startsWith("i.")) {
if (!type.startsWith("library-")) { if (!type.startsWith("library-")) {
type = "library-" + type type = "library-" + type
} }
@ -3262,8 +3276,8 @@ const app = new Vue({
}, },
love(item) { love(item) {
let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let type = item.type.slice(-1) === "s" ? item.type : item.type + "s"
let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id)
if (item.id.startsWith("i.")) { if (item.id != null && (item.id.toString()).startsWith("i.")) {
if (!type.startsWith("library-")) { if (!type.startsWith("library-")) {
type = "library-" + type type = "library-" + type
} }
@ -3283,8 +3297,8 @@ const app = new Vue({
}, },
dislike(item) { dislike(item) {
let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let type = item.type.slice(-1) === "s" ? item.type : item.type + "s"
let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id)
if (item.id.startsWith("i.")) { if (item.id != null && (item.id.toString()).startsWith("i.")) {
if (!type.startsWith("library-")) { if (!type.startsWith("library-")) {
type = "library-" + type type = "library-" + type
} }
@ -3732,6 +3746,7 @@ const app = new Vue({
} }
}, },
skipToNextItem(){ skipToNextItem(){
app.prevButtonBackIndicator = false;
// app.mk.skipToNextItem() is buggy somehow so use this // app.mk.skipToNextItem() is buggy somehow so use this
if (this.mk.queue.nextPlayableItemIndex != -1 && this.mk.queue.nextPlayableItemIndex != null) if (this.mk.queue.nextPlayableItemIndex != -1 && this.mk.queue.nextPlayableItemIndex != null)
this.mk.changeToMediaAtIndex(this.mk.queue.nextPlayableItemIndex); this.mk.changeToMediaAtIndex(this.mk.queue.nextPlayableItemIndex);
@ -3740,6 +3755,10 @@ const app = new Vue({
// app.mk.skipToPreviousItem() is buggy somehow so use this // app.mk.skipToPreviousItem() is buggy somehow so use this
if (this.mk.queue.previousPlayableItemIndex != -1 && this.mk.queue.previousPlayableItemIndex != null) if (this.mk.queue.previousPlayableItemIndex != -1 && this.mk.queue.previousPlayableItemIndex != null)
this.mk.changeToMediaAtIndex(this.mk.queue.previousPlayableItemIndex); this.mk.changeToMediaAtIndex(this.mk.queue.previousPlayableItemIndex);
},
mediaKeyFixes(){
navigator.mediaSession.setActionHandler('previoustrack', function() { app.prevButton() });
navigator.mediaSession.setActionHandler('nexttrack', function() { app.skipToNextItem() });
} }
} }
}) })
@ -3849,7 +3868,7 @@ function fallbackinitMusicKit() {
}, },
sourceType: 24, sourceType: 24,
suppressErrorDialog: true suppressErrorDialog: true
}); })
setTimeout(() => { setTimeout(() => {
app.init() app.init()
}, 1000) }, 1000)

View file

@ -0,0 +1,17 @@
body[platform="darwin"] {
html {
background: transparent!important;
}
&.notransparency::before {
display: none;
}
#app {
&.simplebg {
background: transparent;
}
&::before {
display: none;
}
}
}

View file

@ -924,6 +924,30 @@
} }
} }
.replay-playlist-container {
.cd-mediaitem-square {
height: 230px;
width: 230px;
.info-rect {
display: none;
}
}
}
.replay-video {
max-height: 300px;
max-width: 800px;
margin: 0 auto;
.mediaitem-artwork {
max-height: 300px;
max-width: 800px;
}
.mediaitem-artwork .animatedartwork-view-box .animated video {
object-fit: cover;
}
}
.top-genres-container { .top-genres-container {
.genre-name { .genre-name {

View file

@ -3110,5 +3110,6 @@ body[platform='darwin'] {
} }
@import url("less/macos.less");
@import url("less/linux.less"); @import url("less/linux.less");
@import url("less/compact.less"); @import url("less/compact.less");

View file

@ -474,7 +474,7 @@
menus.normal.headerItems.find(x => x.id == 'dislike').hidden = true menus.normal.headerItems.find(x => x.id == 'dislike').hidden = true
} }
} catch (err) { } catch (err) {
console.log(err)
} }
}, },
visibilityChanged: function (isVisible, entry) { visibilityChanged: function (isVisible, entry) {

View file

@ -12,6 +12,7 @@
:size="size" :size="size"
shadow="subtle" shadow="subtle"
:bgcolor="getBgColor()" :bgcolor="getBgColor()"
:video-priority="forceVideo"
:type="item.type"></mediaitem-artwork> :type="item.type"></mediaitem-artwork>
</div> </div>
<button class="menu-btn" v-if="!nomenu.includes(item.type)" <button class="menu-btn" v-if="!nomenu.includes(item.type)"
@ -57,6 +58,10 @@
type: String, type: String,
default: '190' default: '190'
}, },
forceVideo: {
type: Boolean,
default: false
},
'contextExt': {type: Object, required: false}, 'contextExt': {type: Object, required: false},
}, },
data: function () { data: function () {

View file

@ -12,6 +12,12 @@
<transition name="replaycard"> <transition name="replaycard">
<div class="replay-viewport" v-if="loaded.id != -1"> <div class="replay-viewport" v-if="loaded.id != -1">
<!-- Stats --> <!-- Stats -->
<div class="replay-video" v-if="false">
<mediaitem-artwork
:url="loaded.playlist.attributes.editorialVideo.motionWideVideo21x9.previewFrame.url"
:video="loaded.playlist.attributes.editorialVideo.motionWideVideo21x9.video"
:video-priority="true"></mediaitem-artwork>
</div>
<h1 class="replay-header">{{ loaded.attributes.year }} Replay</h1> <h1 class="replay-header">{{ loaded.attributes.year }} Replay</h1>
<hr> <hr>
<div class="row"> <div class="row">
@ -21,8 +27,8 @@
<h4>{{ loaded.attributes.uniqueArtistCount }} Unique Artists</h4> <h4>{{ loaded.attributes.uniqueArtistCount }} Unique Artists</h4>
<h4>{{ loaded.attributes.uniqueSongCount }} Unique Songs</h4> <h4>{{ loaded.attributes.uniqueSongCount }} Unique Songs</h4>
</div> </div>
<div class="col-auto"> <div class="col-auto replay-playlist-container">
<mediaitem-square kind="card" :item="loaded.relationships.playlist.data[0]"></mediaitem-square> <mediaitem-square kind="card" :force-video="true" :item="loaded.playlist"></mediaitem-square>
</div> </div>
</div> </div>
<!-- Top Artists--> <!-- Top Artists-->
@ -136,8 +142,11 @@
async getReplayYear(year = new Date().getFullYear()) { async getReplayYear(year = new Date().getFullYear()) {
this.loaded.id = -1 this.loaded.id = -1
let response = await app.mk.api.v3.music(`/v1/me/music-summaries/year-${year}?extend=inLibrary&views=top-artists%2Ctop-albums%2Ctop-songs&include[music-summaries]=playlist&include[playlists]=tracks&includeOnly=playlist%2Ctracks%2Csong%2Cartist%2Calbum`) let response = await app.mk.api.v3.music(`/v1/me/music-summaries/year-${year}?extend=inLibrary&views=top-artists%2Ctop-albums%2Ctop-songs&include[music-summaries]=playlist&include[playlists]=tracks&includeOnly=playlist%2Ctracks%2Csong%2Cartist%2Calbum`)
console.warn(response.data.data[0]) let replayData = response.data.data[0]
this.loaded = response.data.data[0] // extended playlist
let playlist = await app.mk.api.v3.music(replayData.relationships.playlist.data[0].href, {extend: "editorialArtwork,editorialVideo"})
replayData.playlist = playlist.data.data[0]
this.loaded = replayData
} }
} }
}); });