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
|
@ -47,6 +47,7 @@ export class BrowserWindow {
|
|||
"pages/library-videos",
|
||||
"pages/remote-pair",
|
||||
"pages/themes-github",
|
||||
"pages/replay",
|
||||
"components/mediaitem-artwork",
|
||||
"components/artwork-material",
|
||||
"components/menu-panel",
|
||||
|
@ -125,6 +126,16 @@ export class BrowserWindow {
|
|||
this.options.width = windowState.width;
|
||||
this.options.height = windowState.height;
|
||||
|
||||
switch(process.platform) {
|
||||
default:
|
||||
|
||||
break;
|
||||
case "linux":
|
||||
this.options.autoHideMenuBar = true
|
||||
this.options.frame = true
|
||||
break;
|
||||
}
|
||||
|
||||
// Start the webserver for the browser window to load
|
||||
|
||||
this.startWebServer();
|
||||
|
@ -699,7 +710,9 @@ export class BrowserWindow {
|
|||
ipcMain.on('get-version', (_event) => {
|
||||
_event.returnValue = app.getVersion()
|
||||
});
|
||||
|
||||
ipcMain.on('open-appdata', (_event) => {
|
||||
shell.openPath(app.getPath('userData'));
|
||||
});
|
||||
/* *********************************************************************************************
|
||||
* Window Events
|
||||
* **********************************************************************************************/
|
||||
|
|
|
@ -27,7 +27,7 @@ export class Store {
|
|||
},
|
||||
"audio": {
|
||||
"volume": 1,
|
||||
"volumeStep": 0.1,
|
||||
"volumeStep": 0.02,
|
||||
"maxVolume": 1,
|
||||
"lastVolume": 1,
|
||||
"muted": false,
|
||||
|
|
|
@ -69,9 +69,9 @@ ipcMain.on('nowPlayingItemDidChange', (_event, attributes) => {
|
|||
CiderPlug.callPlugins('onNowPlayingItemDidChange', attributes);
|
||||
});
|
||||
|
||||
ipcMain.on('lfmItemChange', (_event, attributes) => {
|
||||
CiderPlug.callPlugins('lfmItemChange', attributes);
|
||||
});
|
||||
ipcMain.on('nowPlayingItemDidChangeLastFM', (_event, attributes) => {
|
||||
CiderPlug.callPlugin('lastfm', 'nowPlayingItemDidChangeLastFM', attributes);
|
||||
})
|
||||
|
||||
app.on('before-quit', () => {
|
||||
CiderPlug.callPlugins('onBeforeQuit');
|
||||
|
|
|
@ -79,46 +79,47 @@ export default class LastFMPlugin {
|
|||
}
|
||||
|
||||
private scrobbleSong(attributes: any) {
|
||||
if(this._timer) clearTimeout(this._timer);
|
||||
if (this._timer) clearTimeout(this._timer);
|
||||
var self = this;
|
||||
this._timer = setTimeout(async () => {
|
||||
const currentAttributes = attributes;
|
||||
const currentAttributes = attributes;
|
||||
|
||||
if (!self._lastfm || self._lastfm.cachedAttributes === attributes) {
|
||||
return
|
||||
}
|
||||
if (!self._lastfm || self._lastfm.cachedAttributes === attributes) {
|
||||
return
|
||||
}
|
||||
|
||||
if (self._lastfm.cachedAttributes) {
|
||||
if (self._lastfm.cachedAttributes.playParams.id === attributes.playParams.id) return;
|
||||
}
|
||||
if (self._lastfm.cachedAttributes) {
|
||||
if (self._lastfm.cachedAttributes.playParams.id === attributes.playParams.id) return;
|
||||
}
|
||||
|
||||
const artist = await this.getPrimaryArtist(attributes)
|
||||
const artist = await this.getPrimaryArtist(attributes)
|
||||
|
||||
if (currentAttributes.status && currentAttributes === attributes) {
|
||||
if (fs.existsSync(this.sessionPath)) {
|
||||
// Scrobble playing song.
|
||||
if (attributes.status === true) {
|
||||
self._lastfm.track.scrobble({
|
||||
'artist': artist,
|
||||
'track': attributes.name,
|
||||
'album': attributes.albumName,
|
||||
'albumArtist': artist,
|
||||
'timestamp': new Date().getTime() / 1000
|
||||
}, function (err: any, scrobbled: any) {
|
||||
if (err) {
|
||||
return console.error('[LastFM] An error occurred while scrobbling', err);
|
||||
}
|
||||
if (currentAttributes.status && currentAttributes === attributes) {
|
||||
if (fs.existsSync(this.sessionPath)) {
|
||||
// Scrobble playing song.
|
||||
if (attributes.status === true) {
|
||||
self._lastfm.track.scrobble({
|
||||
'artist': artist,
|
||||
'track': attributes.name,
|
||||
'album': attributes.albumName,
|
||||
'albumArtist': artist,
|
||||
'timestamp': new Date().getTime() / 1000
|
||||
}, function (err: any, scrobbled: any) {
|
||||
if (err) {
|
||||
return console.error('[LastFM] An error occurred while scrobbling', err);
|
||||
}
|
||||
|
||||
console.log('[LastFM] Successfully scrobbled: ', scrobbled);
|
||||
});
|
||||
self._lastfm.cachedAttributes = attributes
|
||||
console.log('[LastFM] Successfully scrobbled: ', scrobbled);
|
||||
});
|
||||
self._lastfm.cachedAttributes = attributes
|
||||
}
|
||||
} else {
|
||||
self.authenticate();
|
||||
}
|
||||
} else {
|
||||
self.authenticate();
|
||||
return console.log('[LastFM] Did not add ', attributes.name, '—', artist, 'because now playing a other song.');
|
||||
}
|
||||
} else {
|
||||
return console.log('[LastFM] Did not add ', attributes.name, '—', artist, 'because now playing a other song.');
|
||||
}},Math.round(attributes.durationInMillis * (self._store.lastfm.scrobble_after / 100)));
|
||||
}, Math.round(attributes.durationInMillis * (self._store.lastfm.scrobble_after / 100)));
|
||||
}
|
||||
|
||||
private async updateNowPlayingSong(attributes: any) {
|
||||
|
@ -155,7 +156,7 @@ export default class LastFMPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
private async getPrimaryArtist (attributes: any) {
|
||||
private async getPrimaryArtist(attributes: any) {
|
||||
const songId = attributes.playParams.catalogId || attributes.playParams.id
|
||||
|
||||
if (!this._store.lastfm.enabledRemoveFeaturingArtists || !songId) return attributes.artistName;
|
||||
|
@ -257,22 +258,22 @@ export default class LastFMPlugin {
|
|||
* @param attributes Music Attributes (attributes.status = current state)
|
||||
*/
|
||||
onPlaybackStateDidChange(attributes: object): void {
|
||||
this.updateNowPlayingSong(attributes)
|
||||
// this.scrobbleSong(attributes)
|
||||
this.updateNowPlayingSong(attributes)
|
||||
// this.scrobbleSong(attributes)
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs on song change
|
||||
* @param attributes Music Attributes
|
||||
*/
|
||||
lfmItemChange(attributes: any): void {
|
||||
nowPlayingItemDidChangeLastFM(attributes: any): void {
|
||||
attributes.status = true
|
||||
if (!this._store.lastfm.filterLoop){
|
||||
if (!this._store.lastfm.filterLoop) {
|
||||
this._lastfm.cachedNowPlayingAttributes = false;
|
||||
this._lastfm.cachedAttributes = false
|
||||
}
|
||||
this.updateNowPlayingSong(attributes)
|
||||
this.scrobbleSong(attributes)
|
||||
this.updateNowPlayingSong(attributes)
|
||||
this.scrobbleSong(attributes)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue