This commit is contained in:
Core 2022-08-24 07:25:09 +01:00
commit 4b2bd5f52f
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0
18 changed files with 194 additions and 44 deletions

View file

@ -2,7 +2,7 @@
"name": "cider", "name": "cider",
"applicationId": "Cider", "applicationId": "Cider",
"productName": "Cider", "productName": "Cider",
"version": "1.5.4", "version": "1.5.5",
"description": "A new cross-platform Apple Music experience based on Electron and Vue.js written from scratch with performance in mind.", "description": "A new cross-platform Apple Music experience based on Electron and Vue.js written from scratch with performance in mind.",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "./build/index.js", "main": "./build/index.js",

View file

@ -632,17 +632,5 @@
"oobe.visual.subtitle": "", "oobe.visual.subtitle": "",
"oobe.visual.text": "", "oobe.visual.text": "",
"oobe.visual.layout.text": "Cider features two window different layouts.\nMaverick is an iTunes like layout with the player at the top of the window.\nMojave is a new spin created by the Cider Collective.\n\nYou can change the layout any time in the settings.", "oobe.visual.layout.text": "Cider features two window different layouts.\nMaverick is an iTunes like layout with the player at the top of the window.\nMojave is a new spin created by the Cider Collective.\n\nYou can change the layout any time in the settings.",
"oobe.visual.suggestingThemes": "Theming is a great way to personalize your experience. Here are a few we suggest: ",
"oobe.visual.suggestingThemes.subtext": "(These themes will be downloaded from GitHub)",
"oobe.visual.suggestingThemes.default": "Cider",
"oobe.visual.suggestingThemes.default.text": "The classic Cider theme.",
"oobe.visual.suggestingThemes.dark": "Dark",
"oobe.visual.suggestingThemes.dark.text": "Darkness.",
"oobe.visual.suggestingThemes.community1": "Groovy",
"oobe.visual.suggestingThemes.community1.text": "A WinUI influenced theme",
"oobe.visual.suggestingThemes.community2": "iTheme",
"oobe.visual.suggestingThemes.community2.text": "The classic big fruit layout.",
"oobe.visual.suggestingThemes.community3": "Dracula",
"oobe.visual.suggestingThemes.community3.text": "The iconic Dracula color scheme.",
"oobe.amsignin.title": "" "oobe.amsignin.title": ""
} }

View file

@ -317,7 +317,7 @@
"menubar.options.toggledevtools": "Toggle Developer Tools", "menubar.options.toggledevtools": "Toggle Developer Tools",
"menubar.options.window": "Window", "menubar.options.window": "Window",
"menubar.options.minimize": "Minimize", "menubar.options.minimize": "Minimize",
"menubar.options.plugins": "Plu-gins Menu", "menubar.options.plugins": "Plugins Menu",
"menubar.options.controls": "Controls", "menubar.options.controls": "Controls",
"menubar.options.volumeup": "Volume Up", "menubar.options.volumeup": "Volume Up",
"menubar.options.volumedown": "Volume Down", "menubar.options.volumedown": "Volume Down",
@ -361,6 +361,8 @@
"settings.prompt.general.keybindings.update.success": "Keybind updated successfully. Press OK to relaunch Cider", "settings.prompt.general.keybindings.update.success": "Keybind updated successfully. Press OK to relaunch Cider",
"settings.option.general.themeUpdateNotification": "Automatically check for theme updates", "settings.option.general.themeUpdateNotification": "Automatically check for theme updates",
"settings.option.general.showLovedTracksInline": "Show loved tracks inline", "settings.option.general.showLovedTracksInline": "Show loved tracks inline",
"settings.option.general.pagination": "Items to show per page",
"settings.options.general.pagination.description": "This determines how many songs/albums to show initially for infinite scrolling, or how many songs/albums to show for a single page",
"settings.description.search": "Search", "settings.description.search": "Search",
"settings.description.albums": "Library Albums", "settings.description.albums": "Library Albums",
"settings.description.artists": "Library Artists", "settings.description.artists": "Library Artists",
@ -630,17 +632,5 @@
"oobe.visual.subtitle": "", "oobe.visual.subtitle": "",
"oobe.visual.text": "", "oobe.visual.text": "",
"oobe.visual.layout.text": "Cider features two window different layouts.\nMaverick is an iTunes like layout with the player at the top of the window.\nMojave is a new spin created by the Cider Collective.\n\nYou can change the layout any time in the settings.", "oobe.visual.layout.text": "Cider features two window different layouts.\nMaverick is an iTunes like layout with the player at the top of the window.\nMojave is a new spin created by the Cider Collective.\n\nYou can change the layout any time in the settings.",
"oobe.visual.suggestingThemes": "Theming is a great way to personalize your experience. Here are a few we suggest: ",
"oobe.visual.suggestingThemes.subtext": "(These themes will be downloaded from GitHub)",
"oobe.visual.suggestingThemes.default": "Cider",
"oobe.visual.suggestingThemes.default.text": "The classic Cider theme.",
"oobe.visual.suggestingThemes.dark": "Dark",
"oobe.visual.suggestingThemes.dark.text": "Darkness.",
"oobe.visual.suggestingThemes.community1": "Groovy",
"oobe.visual.suggestingThemes.community1.text": "A WinUI influenced theme",
"oobe.visual.suggestingThemes.community2": "iTheme",
"oobe.visual.suggestingThemes.community2.text": "The classic big fruit layout.",
"oobe.visual.suggestingThemes.community3": "Dracula",
"oobe.visual.suggestingThemes.community3.text": "The iconic Dracula color scheme.",
"oobe.amsignin.title": "" "oobe.amsignin.title": ""
} }

View file

@ -120,6 +120,11 @@ export class BrowserWindow {
"components/settings-plugins-github", "components/settings-plugins-github",
], ],
appRoutes: [ appRoutes: [
{
page: "lzedit",
component: `<i18n-editor></i18n-editor>`,
condition: "$root.page == 'lzedit'",
},
{ {
page: "library-recentlyadded", page: "library-recentlyadded",
component: `<cider-recentlyadded></cider-recentlyadded>`, component: `<cider-recentlyadded></cider-recentlyadded>`,

View file

@ -189,7 +189,7 @@ export class Store {
transparent: false, transparent: false,
miniplayer_top_toggle: true, miniplayer_top_toggle: true,
directives: { directives: {
windowLayout: "default", windowLayout: "twopanel",
}, },
windowControlPosition: 0, // 0 default right windowControlPosition: 0, // 0 default right
nativeTitleBar: false, nativeTitleBar: false,

View file

@ -367,7 +367,7 @@ const CiderAudio = {
if (!CiderAudio.ccON) { if (!CiderAudio.ccON) {
CiderAudio.ccON = true; CiderAudio.ccON = true;
let searchInt = setInterval(async function () { let searchInt = setInterval(async function () {
if (CiderAudio.context != null && CiderAudio.audioNodes.gainNode != null) { if (CiderAudio.context != null && CiderAudio.audioNodes.intelliGainComp != null) {
// var options = { // var options = {
// mimeType: 'audio/webm; codecs=opus' // mimeType: 'audio/webm; codecs=opus'
// }; // };

View file

@ -228,7 +228,6 @@ function isJson(item) {
webGPU().then(); webGPU().then();
function showOobe() { function showOobe() {
return false;
if (localStorage.getItem("music.ampwebplay.media-user-token") && localStorage.getItem("seenOOBE")) { if (localStorage.getItem("music.ampwebplay.media-user-token") && localStorage.getItem("seenOOBE")) {
return false; return false;
} else { } else {

View file

@ -908,7 +908,7 @@
} }
.cd-mediaitem-mvview .artwork { .cd-mediaitem-mvview .artwork {
height: 172px; height: auto;
width: 300px; width: 300px;
background: blue; background: blue;
border-top-left-radius: 6px; border-top-left-radius: 6px;
@ -918,6 +918,7 @@
flex: 0 0 auto; flex: 0 0 auto;
margin: 6px; margin: 6px;
margin-top: 0px; margin-top: 0px;
aspect-ratio: 1.7435897435897436;
} }
.cd-mediaitem-mvview-overlay { .cd-mediaitem-mvview-overlay {

View file

@ -1480,6 +1480,22 @@
} }
} }
.i18n-page {
textarea {
background: black;
color: #eee;
font-weight: bold;
font-size: 1em;
font-family: system-ui, "Pretendard Variable";
padding: 0.5em;
}
.selectCol {
display: flex;
align-items: center;
}
}
// AudioLabs page // AudioLabs page
.audiolabs-page { .audiolabs-page {
padding: 0px; padding: 0px;

View file

@ -10,6 +10,7 @@ import { MusicKitTools } from "./musickittools.js";
import { spawnMica } from "./mica.js"; import { spawnMica } from "./mica.js";
import { svgIcon } from "./components/svg-icon.js"; import { svgIcon } from "./components/svg-icon.js";
import { sidebarLibraryItem } from "./components/sidebar-library-item.js"; import { sidebarLibraryItem } from "./components/sidebar-library-item.js";
import { i18nEditor } from "./components/i18n-editor.js";
// Define window objects // Define window objects
window.app = app; window.app = app;

View file

@ -0,0 +1,78 @@
import { html } from "../html.js";
export const i18nEditor = Vue.component("i18n-editor", {
// language=HTML
template: html`
<div class="content-inner i18n-page">
<div class="row nopadding">
<div class="col nopadding">
<h1>i18n Editor</h1>
</div>
<div class="col-auto nopadding selectCol">
<select class="md-select" @change="$root.setLz('');$root.setLzManual()" v-model="$root.cfg.general.language">
<optgroup :label="index" v-for="(categories, index) in getLanguages()">
<option v-for="lang in categories" :value="lang.code">{{lang.nameNative}} ({{lang.nameEnglish }})</option>
</optgroup>
</select>
<button class="md-btn" @click="exportLz">Export</button>
</div>
</div>
<hr />
<div class="md-option-container">
<template v-for="(val, key) in baseLz">
<div class="md-option-line" v-if="$root.lz[key]">
<div class="md-option-segment">{{ key }}</div>
<div class="md-option-segment">
<template v-if='typeof $root.lz[key] == "object"'>
<div v-for="(variant, vkey) in $root.lz[key]">
{{variant}}
<input type="text" v-model="$root.lz[key][vkey]" />
</div>
</template>
<textarea type="text" v-model="$root.lz[key]" v-else></textarea>
</div>
</div>
<div class="md-option-line" v-else>
<div class="md-option-segment">
<b>{{ key }}</b>
</div>
<div class="md-option-segment">
<textarea type="text" v-model="$root.lz[key]" :placeholder="val"></textarea>
</div>
</div>
</template>
</div>
</div>
`,
data() {
return {
listing: ipcRenderer.sendSync("get-i18n-listing"),
baseLz: ipcRenderer.sendSync("get-i18n", "en_US"),
};
},
methods: {
exportLz() {
bootbox.alert(`<textarea spellcheck='false' style="width:100%;height: 300px;">${JSON.stringify(app.lz, true, " ")}</textarea>`);
notyf.success("Copied to clipboard");
navigator.clipboard.writeText(JSON.stringify(app.lz, true, " ")).then((r) => console.debug("Copied to clipboard."));
},
getLanguages: function () {
let langs = this.$root.lzListing;
let categories = {
main: [],
fun: [],
unsorted: [],
};
// sort by category if category is undefined or empty put it in "unsorted"
for (let i = 0; i < langs.length; i++) {
if (langs[i].category === undefined || langs[i].category === "") {
categories.unsorted.push(langs[i]);
} else {
categories[langs[i].category].push(langs[i]);
}
}
// return
return categories;
},
},
});

View file

@ -50,6 +50,7 @@ const Events = {
}); });
app.showCollection(hist.data, app.getLz("term.history")); app.showCollection(hist.data, app.getLz("term.history"));
} }
// CTRL+F10
if (event.ctrlKey && event.keyCode == 121) { if (event.ctrlKey && event.keyCode == 121) {
try { try {
app.mk._services.mediaItemPlayback._currentPlayer.stop(); app.mk._services.mediaItemPlayback._currentPlayer.stop();
@ -57,7 +58,19 @@ const Events = {
try { try {
app.mk._services.mediaItemPlayback._currentPlayer.destroy(); app.mk._services.mediaItemPlayback._currentPlayer.destroy();
} catch (e) {} } catch (e) {}
try {
let searchInt = setInterval(function () {
if (document.getElementById("apple-music-player")) {
//AudioOutputs.eqReady = true;
document.getElementById("apple-music-player").crossOrigin = "anonymous";
CiderAudio.source = CiderAudio.context.createMediaElementSource(document.getElementById("apple-music-player"));
CiderAudio.source.connect(CiderAudio.audioNodes.intelliGainComp);
clearInterval(searchInt);
} }
}, 1000);
} catch (e) {}
}
// CTRL+F11
if (event.ctrlKey && event.keyCode == 122) { if (event.ctrlKey && event.keyCode == 122) {
try { try {
ipcRenderer.send("detachDT", ""); ipcRenderer.send("detachDT", "");

View file

@ -22,6 +22,7 @@ const app = new Vue({
lzListing: ipcRenderer.sendSync("get-i18n-listing"), lzListing: ipcRenderer.sendSync("get-i18n-listing"),
search: { search: {
term: "", term: "",
cursor: -1,
hints: [], hints: [],
showHints: false, showHints: false,
results: {}, results: {},
@ -3875,6 +3876,17 @@ const app = new Vue({
break; break;
} }
}, },
searchCursor(e) {
if (e.keyCode == "40") {
if (this.search.hints.length - 1 < this.search.cursor + 1) return;
this.search.cursor++;
this.search.term = this.search.hints[this.search.cursor];
} else if (e.keyCode == "38") {
if (this.search.cursor == 0) return;
this.search.cursor--;
this.search.term = this.search.hints[this.search.cursor];
}
},
async searchQuery(term = this.search.term) { async searchQuery(term = this.search.term) {
let self = this; let self = this;
if (term == "") { if (term == "") {

View file

@ -724,6 +724,7 @@ input[type="range"].web-slider::-webkit-slider-runnable-track {
.search-hints-container { .search-hints-container {
top: 44px; top: 44px;
background: rgb(30 30 30);
#cmenu.container(); #cmenu.container();
.search-hints { .search-hints {
@ -731,6 +732,10 @@ input[type="range"].web-slider::-webkit-slider-runnable-track {
.search-hint { .search-hint {
#cmenu.item(); #cmenu.item();
&.active {
background: var(--keyColor);
}
} }
} }
} }

View file

@ -280,15 +280,16 @@
<input type="search" spellcheck="false" @click="$root.appRoute('search');" <input type="search" spellcheck="false" @click="$root.appRoute('search');"
@focus="search.showHints = true" @focus="search.showHints = true"
@blur="setTimeout(()=>{search.showHints = false}, 300)" @blur="setTimeout(()=>{search.showHints = false}, 300)"
v-on:keyup.enter="searchQuery();search.showHints = false" @change="$root.appRoute('search');" v-on:keyup.enter="searchQuery();search.showHints = false;search.cursor = -1" @change="$root.appRoute('search');"
v-on:keyup="searchCursor"
@input="getSearchHints()" @input="getSearchHints()"
:placeholder="$root.getLz('term.search') + '...'" v-model="search.term" ref="searchInput" :placeholder="$root.getLz('term.search') + '...'" v-model="search.term" ref="searchInput"
class="search-input" /> class="search-input" />
<div class="search-hints-container" v-if="search.showHints && search.hints.length != 0"> <div class="search-hints-container" v-if="search.showHints && search.hints.length != 0">
<div class="search-hints"> <div class="search-hints">
<button class="search-hint text-overflow-elipsis" v-for="hint in search.hints" <button class="search-hint text-overflow-elipsis" :class="{active: (search.cursor == index)}" v-for="(hint, index) in search.hints"
@click="search.term = hint;search.showHints = false;searchQuery(hint)"> @click="search.term = hint;search.showHints = false;searchQuery(hint);search.cursor = -1">
{{ hint }} {{ hint }}
</button> </button>
</div> </div>

View file

@ -15,7 +15,7 @@
</div> </div>
<div class="artwork"> <div class="artwork">
<mediaitem-artwork <mediaitem-artwork
:url="item.attributes?.artwork ? item.attributes?.artwork?.url : ''" :url="item.attributes?.editorialArtwork.subscriptionHero.url ?? item.attributes?.artwork"
:video="(item.attributes != null && item.attributes?.editorialVideo != null) ? (item.attributes?.editorialVideo?.motionDetailSquare ? item.attributes?.editorialVideo?.motionDetailSquare?.video : (item.attributes?.editorialVideo?.motionSquareVideo1x1 ? item?.attributes?.editorialVideo?.motionSquareVideo1x1?.video : '')) : '' " :video="(item.attributes != null && item.attributes?.editorialVideo != null) ? (item.attributes?.editorialVideo?.motionDetailSquare ? item.attributes?.editorialVideo?.motionDetailSquare?.video : (item.attributes?.editorialVideo?.motionSquareVideo1x1 ? item?.attributes?.editorialVideo?.motionSquareVideo1x1?.video : '')) : '' "
:size="516" :width="900" :size="516" :width="900"
></mediaitem-artwork> ></mediaitem-artwork>

View file

@ -10,7 +10,8 @@
@click="$root.appRoute('search');" @click="$root.appRoute('search');"
@focus="$root.search.showHints = true" @focus="$root.search.showHints = true"
@blur="$root.setTimeout(()=>{$root.search.showHints = false}, 300)" @blur="$root.setTimeout(()=>{$root.search.showHints = false}, 300)"
v-on:keyup.enter="$root.searchQuery();$root.search.showHints = false" v-on:keyup.enter="$root.searchQuery();$root.search.showHints = false;$root.search.cursor = -1"
v-on:keyup="$root.searchCursor"
@change="$root.appRoute('search');" @change="$root.appRoute('search');"
@input="$root.getSearchHints()" @input="$root.getSearchHints()"
:placeholder="$root.getLz('term.search') + '...'" :placeholder="$root.getLz('term.search') + '...'"
@ -27,7 +28,7 @@
<button <button
class="search-hint text-overflow-elipsis" class="search-hint text-overflow-elipsis"
v-for="hint in $root.search.hints" v-for="hint in $root.search.hints"
@click="$root.search.term = hint;$root.search.showHints = false;$root.searchQuery(hint)" @click="$root.search.term = hint;$root.search.showHints = false;$root.searchQuery(hint);$root.search.cursor = -1"
> >
{{ hint }} {{ hint }}
</button> </button>

View file

@ -6,10 +6,32 @@
<div class="oobe-header"> <div class="oobe-header">
{{ getLz("oobe.amupsell.title") }} {{ getLz("oobe.amupsell.title") }}
</div> </div>
<div class="oobe-body text">{{ getLz("oobe.amupsell.text") }}</div> <div class="oobe-body text">{{ getLz("oobe.amupsell.text") }}
<div class="md-option-line">
<div class="md-option-segment">
{{$root.getLz('term.language')}}
</div>
<div class="md-option-segment md-option-segment_auto">
<label>
<select class="md-select" @change="$root.setLz('');$root.setLzManual()"
v-model="$root.cfg.general.language">
<optgroup :label="index" v-for="(categories, index) in getLanguages()">
<option v-for="lang in categories" :value="lang.code">
{{lang.nameNative}}
({{
lang.nameEnglish }})
</option>
</optgroup>
</select>
</label>
</div>
</div>
</div>
<div class="oobe-footer"> <div class="oobe-footer">
<div class="btn-group"> <div class="btn-group">
<div class="md-btn" @click="screen = 'welcome'">{{ getLz("oobe.next") }}</div> <div class="md-btn md-btn-primary" @click="screen = 'welcome'">{{ getLz("oobe.next") }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -25,7 +47,7 @@
<div class="oobe-footer"> <div class="oobe-footer">
<div class="btn-group"> <div class="btn-group">
<div class="md-btn" @click="screen = 'before_we_start'">{{ getLz("oobe.previous") }}</div> <div class="md-btn" @click="screen = 'before_we_start'">{{ getLz("oobe.previous") }}</div>
<div class="md-btn" @click="screen = 'general'">{{ getLz("oobe.next") }}</div> <div class="md-btn md-btn-primary" @click="screen = 'visual'">{{ getLz("oobe.next") }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -37,11 +59,11 @@
<div class="oobe-header"> <div class="oobe-header">
{{ getLz("oobe.general.title") }} {{ getLz("oobe.general.title") }}
</div> </div>
<div class="oobe-body text">{{ getLz("oobe.general.text") }}</div> <div class="oobe-body text"></div>
<div class="oobe-footer"> <div class="oobe-footer">
<div class="btn-group"> <div class="btn-group">
<div class="md-btn" @click="screen = 'welcome'">{{ getLz("oobe.previous") }}</div> <div class="md-btn" @click="screen = 'welcome'">{{ getLz("oobe.previous") }}</div>
<div class="md-btn" @click="screen = 'visual'">{{ getLz("oobe.next") }}</div> <div class="md-btn md-btn-primary" @click="screen = 'visual'">{{ getLz("oobe.next") }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -84,8 +106,8 @@
</div> </div>
<div class="oobe-footer"> <div class="oobe-footer">
<div class="btn-group"> <div class="btn-group">
<div class="md-btn" @click="screen = 'general'">{{ getLz("oobe.previous") }}</div> <div class="md-btn" @click="screen = 'welcome'">{{ getLz("oobe.previous") }}</div>
<div class="md-btn" @click="screen = 'audio'">{{ getLz("oobe.next") }}</div> <div class="md-btn md-btn-primary" @click="screen = 'audio'">{{ getLz("oobe.next") }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -118,7 +140,7 @@
<div class="oobe-footer"> <div class="oobe-footer">
<div class="btn-group"> <div class="btn-group">
<div class="md-btn" @click="screen = 'visual'">{{ getLz("oobe.previous") }}</div> <div class="md-btn" @click="screen = 'visual'">{{ getLz("oobe.previous") }}</div>
<div class="md-btn" @click="signIn()">{{ getLz("oobe.next") }}</div> <div class="md-btn md-btn-primary" @click="signIn()">{{ getLz("oobe.next") }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -164,6 +186,24 @@
}, },
getLz() { getLz() {
return this.$root.getLz.apply(this.$root, arguments); return this.$root.getLz.apply(this.$root, arguments);
},
getLanguages: function() {
let langs = this.$root.lzListing
let categories = {
"main": [],
"fun": [],
"unsorted": []
}
// sort by category if category is undefined or empty put it in "unsorted"
for (let i = 0; i < langs.length; i++) {
if (langs[i].category === undefined || langs[i].category === "") {
categories.unsorted.push(langs[i])
} else {
categories[langs[i].category].push(langs[i])
}
}
// return
return categories
} }
} }
}); });