Changed if() to if ()
This commit is contained in:
parent
91ac19974c
commit
9c85fafd1d
22 changed files with 44 additions and 44 deletions
|
@ -26,7 +26,7 @@ export class Plugins {
|
|||
}
|
||||
|
||||
public static getPluginFromMap(plugin: string): any {
|
||||
if(Plugins.PluginMap[plugin]) {
|
||||
if (Plugins.PluginMap[plugin]) {
|
||||
return Plugins.PluginMap[plugin];
|
||||
}else{
|
||||
return plugin;
|
||||
|
|
|
@ -105,7 +105,7 @@ function fallbackinitMusicKit() {
|
|||
})
|
||||
setTimeout(() => {
|
||||
app.init()
|
||||
if(app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
app.spawnMica()
|
||||
}
|
||||
}, 1000)
|
||||
|
@ -134,7 +134,7 @@ document.addEventListener('musickitloaded', function () {
|
|||
function waitForApp() {
|
||||
if (typeof app.init !== "undefined") {
|
||||
app.init()
|
||||
if(app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
app.spawnMica()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ const Events = {
|
|||
if (event.keyCode === 82 && event.ctrlKey) {
|
||||
event.preventDefault()
|
||||
bootbox.confirm("Reload Cider?", (res)=>{
|
||||
if(res) {
|
||||
if (res) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -251,7 +251,7 @@ function simulateGamepad () {
|
|||
|
||||
cursorPos[1] -= cursorSpeed
|
||||
// sounds.Hover.play()
|
||||
// if(intTabIndex <= 0) {
|
||||
// if (intTabIndex <= 0) {
|
||||
// intTabIndex = 0
|
||||
// }else{
|
||||
// intTabIndex--
|
||||
|
@ -263,7 +263,7 @@ function simulateGamepad () {
|
|||
e.preventDefault()
|
||||
|
||||
cursorPos[1] += cursorSpeed
|
||||
// if(intTabIndex < tabbable.length) {
|
||||
// if (intTabIndex < tabbable.length) {
|
||||
// intTabIndex++
|
||||
// }else{
|
||||
// intTabIndex = tabbable.length
|
||||
|
|
|
@ -1671,7 +1671,7 @@ const app = new Vue({
|
|||
params["meta[albums:tracks]"] = 'popularity'
|
||||
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);
|
||||
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
||||
app.getTypeFromID((kind), (id), (isLibrary), params);
|
||||
|
|
|
@ -108,9 +108,9 @@ const wsapi = {
|
|||
app.mk.isPlaying ? app.mk.pause() : app.mk.play()
|
||||
},
|
||||
toggleRepeat() {
|
||||
if(MusicKit.getInstance().repeatMode == 0) {
|
||||
if (MusicKit.getInstance().repeatMode == 0) {
|
||||
MusicKit.getInstance().repeatMode = 1
|
||||
}else if(MusicKit.getInstance().repeatMode == 1){
|
||||
}else if (MusicKit.getInstance().repeatMode == 1){
|
||||
MusicKit.getInstance().repeatMode = 2
|
||||
}else{
|
||||
MusicKit.getInstance().repeatMode = 0
|
||||
|
|
|
@ -133,7 +133,7 @@ app.mkapi("artists", false, "412778295", {
|
|||
var library = []
|
||||
var downloaded = null;
|
||||
function downloadChunk () {
|
||||
if(downloaded == null) {
|
||||
if (downloaded == null) {
|
||||
app.mk.api.library.songs("", {limit: 100}, {includeResponseMeta: !0}).then((response)=>{
|
||||
processChunk(response)
|
||||
})
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
template: '#artist-chip',
|
||||
async mounted() {
|
||||
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
|
||||
}
|
||||
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artistId}`).then(response => {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
app.modals.audioSettings = false
|
||||
},
|
||||
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.audioSettings = false
|
||||
} else {
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
},
|
||||
methods: {
|
||||
seekTo(startTime) {
|
||||
if(startTime != 9999999) this.app.seekTo(startTime, false);
|
||||
if (startTime != 9999999) this.app.seekTo(startTime, false);
|
||||
},
|
||||
getActiveLyric() {
|
||||
const delayfix = 0.1
|
||||
|
@ -125,7 +125,7 @@
|
|||
if (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(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")
|
||||
if (this.checkIfScrollIsStatic) {
|
||||
let lyricElement = this.$refs.lyricsview.querySelector(`.lyric-line[line-index="${i}"]`)
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
}, event)
|
||||
},
|
||||
getVideoPriority() {
|
||||
if(app.cfg.visual.animated_artwork == "always") {
|
||||
if (app.cfg.visual.animated_artwork == "always") {
|
||||
return true;
|
||||
}else if (this.videoPriority && app.cfg.visual.animated_artwork == "limited") {
|
||||
return true
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
},
|
||||
getClasses() {
|
||||
this.addClasses = {}
|
||||
if(typeof this.item.attributes.playParams == "undefined") {
|
||||
if (typeof this.item.attributes.playParams == "undefined") {
|
||||
this.addClasses["disabled"] = true
|
||||
}
|
||||
if (this.classList) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<div class="title text-overflow-elipsis" @click='app.routeView(item)'>
|
||||
{{ item.attributes.name ?? '' }}
|
||||
</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 ?? '' }}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -93,12 +93,12 @@
|
|||
},
|
||||
async mounted() {
|
||||
await this.getBadges()
|
||||
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 (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)) {
|
||||
this.unavailable = true
|
||||
}
|
||||
}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
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@
|
|||
}
|
||||
},
|
||||
getSubtitle() {
|
||||
if(this.kind == 'card') {
|
||||
if (this.kind == 'card') {
|
||||
try {
|
||||
if (typeof this.item.attributes.artistNames != "undefined") {
|
||||
return this.item.attributes.artistNames
|
||||
|
@ -139,7 +139,7 @@
|
|||
}
|
||||
},
|
||||
getSubtitleNavigation() {
|
||||
if(this.kind == 'card') {
|
||||
if (this.kind == 'card') {
|
||||
try {
|
||||
if (typeof this.item.attributes.artistNames != "undefined") {
|
||||
return app.routeView(this.item)
|
||||
|
@ -224,7 +224,7 @@
|
|||
},
|
||||
getArtworkUrl(size = -1, includeUrl = false) {
|
||||
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"))
|
||||
}
|
||||
switch (this.kind) {
|
||||
|
@ -232,7 +232,7 @@
|
|||
artwork = this.item.attributes.editorialArtwork?.subscriptionHero?.url ?? (this.item.attributes.artwork?.url ?? (this.item.relationships?.contents?.data[0]?.attributes?.editorialArtwork?.subscriptionHero?.url ?? ''))
|
||||
break;
|
||||
}
|
||||
if(!includeUrl) {
|
||||
if (!includeUrl) {
|
||||
return artwork
|
||||
}else{
|
||||
return `url("${artwork}")`
|
||||
|
@ -471,7 +471,7 @@
|
|||
|
||||
try {
|
||||
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 == 'removeFromLibrary').hidden = false
|
||||
}else{
|
||||
|
@ -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"
|
||||
}
|
||||
app.showMenuPanel({
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
this.history = history.data.data
|
||||
},
|
||||
select(e, position) {
|
||||
if(e.ctrlKey || e.shiftKey) {
|
||||
if(this.selectedItems.indexOf(position) == -1) {
|
||||
if (e.ctrlKey || e.shiftKey) {
|
||||
if (this.selectedItems.indexOf(position) == -1) {
|
||||
this.selectedItems.push(position)
|
||||
} else {
|
||||
this.selectedItems.splice(this.selectedItems.indexOf(position), 1)
|
||||
|
@ -83,7 +83,7 @@
|
|||
queueContext(event, item, position) {
|
||||
let self = this
|
||||
let useMenu = "single"
|
||||
if(this.selectedItems.length > 1) {
|
||||
if (this.selectedItems.length > 1) {
|
||||
useMenu = "multiple"
|
||||
}
|
||||
let menus = {
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
},
|
||||
methods: {
|
||||
playlistSelect(playlist) {
|
||||
if(playlist.type != "library-playlist-folders") {
|
||||
if (playlist.type != "library-playlist-folders") {
|
||||
this.addToPlaylist(playlist.id)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -294,7 +294,7 @@
|
|||
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.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.ready = true
|
||||
|
@ -320,7 +320,7 @@
|
|||
},
|
||||
objectContainerStyle() {
|
||||
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)
|
||||
}
|
||||
let style = {
|
||||
|
@ -346,7 +346,7 @@
|
|||
window.CiderAudio.audioNodes.spatialNode.setRoomProperties(this.room_dimensions, this.room_materials);
|
||||
CiderAudio.audioNodes.spatialInput.setPosition(...this.audio_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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
app.showMenuPanel({
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
self.themes = []
|
||||
notyf.success(app.getLz('settings.notyf.visual.plugin.install.success'));
|
||||
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
ipcRenderer.invoke("relaunchApp")
|
||||
}else{
|
||||
return
|
||||
|
@ -154,7 +154,7 @@
|
|||
if (arg.success) {
|
||||
self.themes = ipcRenderer.sendSync("get-themes")
|
||||
bootbox.confirm(app.getLz("settings.prompt.visual.plugin.github.success"), (ok)=>{
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
ipcRenderer.invoke("relaunchApp")
|
||||
}else{
|
||||
return
|
||||
|
|
|
@ -187,7 +187,7 @@
|
|||
},
|
||||
searchPodcasts() {
|
||||
let self = this
|
||||
if(this.search.term == "") {
|
||||
if (this.search.term == "") {
|
||||
return
|
||||
}
|
||||
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) {
|
||||
|
||||
let podcastShow = await app.mk.api.v3.podcasts(next)
|
||||
if(podcastId != this.podcastSelected.id) {
|
||||
if (podcastId != this.podcastSelected.id) {
|
||||
return
|
||||
}
|
||||
podcastShow.data.data.forEach(ep => {
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
return "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"
|
||||
}
|
||||
height = parseInt(height * window.devicePixelRatio)
|
||||
if(width) {
|
||||
if (width) {
|
||||
width = parseInt(width * window.devicePixelRatio)
|
||||
}
|
||||
let newurl = `${url.replace('{w}', width ?? height).replace('{h}', height).replace('{f}', "webp").replace('{c}', ((width === 900) ? "sr" : "cc"))}`;
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
},
|
||||
getSubtitle() {
|
||||
if(this.kind == 'card') {
|
||||
if (this.kind == 'card') {
|
||||
try {
|
||||
if (typeof this.item.attributes.artistNames != "undefined") {
|
||||
return this.item.attributes.artistNames
|
||||
|
@ -116,7 +116,7 @@
|
|||
}
|
||||
},
|
||||
getSubtitleNavigation() {
|
||||
if(this.kind == 'card') {
|
||||
if (this.kind == 'card') {
|
||||
try {
|
||||
if (typeof this.item.attributes.artistNames != "undefined") {
|
||||
return app.routeView(this.item)
|
||||
|
@ -200,7 +200,7 @@
|
|||
},
|
||||
getArtworkUrl(size = -1, includeUrl = false) {
|
||||
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"))
|
||||
}
|
||||
switch (this.kind) {
|
||||
|
@ -208,7 +208,7 @@
|
|||
artwork = this.item.attributes.editorialArtwork.subscriptionHero.url
|
||||
break;
|
||||
}
|
||||
if(!includeUrl) {
|
||||
if (!includeUrl) {
|
||||
return artwork
|
||||
}else{
|
||||
return `url("${artwork}")`
|
||||
|
@ -423,7 +423,7 @@
|
|||
|
||||
try {
|
||||
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 == 'removeFromLibrary').hidden = false
|
||||
}else{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue