Sync I don't commit now is the conflict of the tomorrow (#472)
* 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 commit24313b53cf
. * ok? * Revert "ok?" This reverts commit9218ccc887
. * 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 commitd36e1b19f6
. * Revert "Merge branch 'develop' into develop" This reverts commit5fa345e6c8
, reversing changes made toa02b633f49
. * Revert "Revert "LastFM can be unique and have its own call"" This reverts commitf156083d48
. * Revert "Merge branch 'ciderapp:develop' into develop" This reverts commit20fd0c05da
, reversing changes made to4937e29fcf
. * lastfm changes * i hate lastfm like really really hate it * Revert "Merge remote-tracking branch 'origin/develop' into develop" This reverts commit5b360e74fa
, reversing changes made to548688341d
. * Revert "Revert "Merge remote-tracking branch 'origin/develop' into develop"" This reverts commit0fb6802ff3
. * Revert "Merge branch 'develop' of https://github.com/ciderapp/Cider into develop" This reverts commitbd3a2b6172
, reversing changes made to0fb6802ff3
. * 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 commitb740f76e3c
, reversing changes made toa5746f08fa
. 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>
This commit is contained in:
parent
509a425f41
commit
8ee22f615d
22 changed files with 546 additions and 134 deletions
|
@ -49,9 +49,21 @@
|
|||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="row" v-if="!seenReplay">
|
||||
<div class="col">
|
||||
<button class="md-btn md-btn-block md-btn-replay--hero" @click="$root.appRoute('replay')">Replay {{ year }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>{{app.getLz('home.madeForYou')}}</h3>
|
||||
<div class="row">
|
||||
<div class="col nopadding">
|
||||
<h3>{{app.getLz('home.madeForYou')}}</h3>
|
||||
</div>
|
||||
<div class="col-auto nopadding flex-center">
|
||||
<button class="md-btn md-btn-replay" v-if="seenReplay" @click="$root.appRoute('replay')">Replay {{ year }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<mediaitem-scroller-horizontal :items="madeForYou" v-if="isSectionReady('madeForYou')">
|
||||
</mediaitem-scroller-horizontal>
|
||||
|
@ -98,7 +110,9 @@
|
|||
artistFeed: [],
|
||||
showingArtistFeed: false,
|
||||
page: "main",
|
||||
sectionsReady: []
|
||||
sectionsReady: [],
|
||||
year: new Date().getFullYear(),
|
||||
seenReplay: localStorage.getItem('seenReplay')
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
@ -106,6 +120,10 @@
|
|||
this.getListenNowData()
|
||||
await this.getArtistFeed()
|
||||
await this.getFavorites()
|
||||
if (new Date().getMonth() == 11) {
|
||||
this.seenReplay = false
|
||||
localStorage.setItem('seenReplay', false)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async seeAllHistory() {
|
||||
|
|
|
@ -15,8 +15,16 @@
|
|||
v-model="library.songs.search" class="search-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto flex-center">
|
||||
<div class="col-auto flex-center">
|
||||
<div class="row">
|
||||
<button class="col md-btn md-btn-primary md-btn-icon" style="min-width: 100px;margin-right: 3px;"
|
||||
@click="app.mk.shuffleMode = 0; play()"> <img class="md-ico-play">
|
||||
{{app.getLz('term.play')}}
|
||||
</button>
|
||||
<button class="col md-btn md-btn-primary md-btn-icon" style="min-width: 100px;margin-right: 3px;"
|
||||
@click="app.mk.shuffleMode = 1;play()"> <img class="md-ico-shuffle">
|
||||
{{app.getLz('term.shuffle')}}
|
||||
</button>
|
||||
<div class="col">
|
||||
<select class="md-select" v-model="prefs.sort" @change="$root.searchLibrarySongs()">
|
||||
<optgroup :label="app.getLz('term.sortBy')">
|
||||
|
@ -75,6 +83,28 @@
|
|||
methods: {
|
||||
sayHello: function () {
|
||||
alert('Hello world!');
|
||||
},
|
||||
play: function () {
|
||||
|
||||
function shuffleArray(array) {
|
||||
for (var i = array.length - 1; i > 0; i--) {
|
||||
var j = Math.floor(Math.random() * (i + 1));
|
||||
var temp = array[i];
|
||||
array[i] = array[j];
|
||||
array[j] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
let query = this.app.library.songs.displayListing.map(item => new MusicKit.MediaItem(item));
|
||||
if (!app.mk.queue.isEmpty)
|
||||
app.mk.queue.splice(0, app.mk.queue._itemIDs.length);
|
||||
app.mk.stop().then(() => {
|
||||
if (app.mk.shuffleMode == 1) {
|
||||
shuffleArray(query)
|
||||
}
|
||||
app.mk.queue.append(query)
|
||||
app.mk.changeToMediaAtIndex(0)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
144
src/renderer/views/pages/replay.ejs
Normal file
144
src/renderer/views/pages/replay.ejs
Normal file
|
@ -0,0 +1,144 @@
|
|||
<script type="text/x-template" id="replay-page">
|
||||
<div class="content-inner replay-page">
|
||||
<vue-horizontal style="height: 300px;">
|
||||
<div class="replay-period" v-for="year in years" @click="getReplayYear(year.attributes.year)">
|
||||
<div class="artwork-container">
|
||||
<mediaitem-artwork :size="200" :url="year.relationships.playlist.data[0].attributes.artwork.url"></mediaitem-artwork>
|
||||
</div>
|
||||
{{ year.attributes.year }}
|
||||
</div>
|
||||
</vue-horizontal>
|
||||
<hr>
|
||||
<transition name="replaycard">
|
||||
<div class="replay-viewport" v-if="loaded.id != -1">
|
||||
<!-- Stats -->
|
||||
<h1 class="replay-header">{{ loaded.attributes.year }} Replay</h1>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4>{{ loaded.attributes.listenTimeInMinutes }} minutes</h4>
|
||||
<h4>{{ loaded.attributes.uniqueAlbumCount }} Unique Albums</h4>
|
||||
<h4>{{ loaded.attributes.uniqueArtistCount }} Unique Artists</h4>
|
||||
<h4>{{ loaded.attributes.uniqueSongCount }} Unique Songs</h4>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<mediaitem-square kind="card" :item="loaded.relationships.playlist.data[0]"></mediaitem-square>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Top Artists-->
|
||||
<h3>Top Artists</h3>
|
||||
<div class="well">
|
||||
<mediaitem-scroller-horizontal>
|
||||
<div class="card replay-card" v-for="artistData in loaded.views['top-artists'].data">
|
||||
<div class="card-body">
|
||||
<mediaitem-square :item="artistData.relationships.artist.data[0]"></mediaitem-square>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ artistData.attributes.listenTimeInMinutes }} minutes<br>
|
||||
Listened to: {{ artistData.attributes.playCount }} times
|
||||
</div>
|
||||
</div>
|
||||
</mediaitem-scroller-horizontal>
|
||||
</div>
|
||||
<!-- Top Albums-->
|
||||
<h3>Top Albums</h3>
|
||||
<div class="well">
|
||||
<mediaitem-scroller-horizontal>
|
||||
<div class="card replay-card" v-for="albumData in loaded.views['top-albums'].data">
|
||||
<div class="card-body">
|
||||
<mediaitem-square :item="albumData.relationships.album.data[0]"></mediaitem-square>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ albumData.attributes.listenTimeInMinutes }} minutes<br>
|
||||
{{ albumData.attributes.playCount }} plays
|
||||
</div>
|
||||
</div>
|
||||
</mediaitem-scroller-horizontal>
|
||||
</div>
|
||||
<!-- Top Songs-->
|
||||
<h3>Top Songs</h3>
|
||||
<div class="well">
|
||||
<listitem-horizontal :show-library-status="false" :items="songsToArray(loaded.views['top-songs'].data)"></listitem-horizontal>
|
||||
</div>
|
||||
<h3>Top Genres</h3>
|
||||
<div class="top-genres-container">
|
||||
<div v-for="genre in loaded.topGenres" class="replay-genre-display">
|
||||
<div class="genre-name">
|
||||
{{ genre.genre }}
|
||||
</div>
|
||||
<div class="genre-count">
|
||||
<div class="genre-count-bar" :style="{'width': genre.count + '%'}">
|
||||
{{ genre.count }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
Vue.component('replay-page', {
|
||||
template: '#replay-page',
|
||||
data: function () {
|
||||
return {
|
||||
years: [],
|
||||
loaded: {
|
||||
id: -1
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
// Get available years
|
||||
let year = await app.mk.api.v3.music("/v1/me/music-summaries/search?extend=inLibrary&period=year&fields[music-summaries]=period%2Cyear&include[music-summaries]=playlist")
|
||||
this.years = year.data.data
|
||||
this.years.reverse()
|
||||
localStorage.setItem("seenReplay", true)
|
||||
this.getReplayYear();
|
||||
},
|
||||
methods: {
|
||||
songsToArray(songsData) {
|
||||
let songs = []
|
||||
let topGenres = {}
|
||||
let genrePlayCount = 0;
|
||||
songsData.forEach(function (songData) {
|
||||
let song = songData.relationships.song.data[0]
|
||||
song.attributes.playCount = songData.attributes.playCount
|
||||
songs.push(song)
|
||||
genrePlayCount += song.attributes.playCount
|
||||
song.attributes.genreNames.forEach(function (genre) {
|
||||
if (genre != "Music") {
|
||||
if (topGenres[genre] == undefined) {
|
||||
topGenres[genre] = song.attributes.playCount
|
||||
} else {
|
||||
topGenres[genre] += song.attributes.playCount
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
let topGenresArray = []
|
||||
for (let genre in topGenres) {
|
||||
topGenresArray.push({
|
||||
genre: genre,
|
||||
count: topGenres[genre]
|
||||
})
|
||||
}
|
||||
topGenresArray.sort(function (a, b) {
|
||||
return b.count - a.count
|
||||
})
|
||||
topGenresArray.forEach(function (genre) {
|
||||
genre.count = Math.round(genre.count / genrePlayCount * 100)
|
||||
})
|
||||
this.loaded.topGenres = topGenresArray
|
||||
|
||||
return songs
|
||||
},
|
||||
async getReplayYear(year = new Date().getFullYear()) {
|
||||
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`)
|
||||
console.warn(response.data.data[0])
|
||||
this.loaded = response.data.data[0]
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -620,6 +620,36 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-option-header">
|
||||
<span>{{$root.getLz('settings.header.debug')}}</span>
|
||||
</div>
|
||||
<div class="settings-option-body">
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.debug.copy_log')}}
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<button class="md-btn" @click="copyLogs">
|
||||
{{$root.getLz('action.copy')}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.debug.openAppData')}}
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<button class="md-btn" @click="openAppData">
|
||||
{{$root.getLz('action.open')}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-option-header">
|
||||
<span>{{$root.getLz('settings.header.experimental')}}</span>
|
||||
</div>
|
||||
|
@ -692,16 +722,6 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.experimental.copy_log')}}
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<button class="md-btn" @click="copyLogs">
|
||||
{{$root.getLz('action.copy')}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="opacity: 0.5; pointer-events: none">
|
||||
<div class="md-option-header">
|
||||
|
@ -791,6 +811,9 @@
|
|||
ipcRenderer.send('fetch-log')
|
||||
notyf.success(app.getLz('term.share.success'));
|
||||
},
|
||||
openAppData() {
|
||||
ipcRenderer.send('open-appdata')
|
||||
},
|
||||
getLanguages: function () {
|
||||
let langs = this.$root.lzListing
|
||||
let categories = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue