somefixes

This commit is contained in:
vapormusic 2022-07-02 09:48:30 +07:00
parent 5bd5d92370
commit 9578dcf85c
4 changed files with 30 additions and 21 deletions

View file

@ -1192,6 +1192,10 @@ export class BrowserWindow {
LocalFiles.cleanUpDB()
})
LocalFiles.eventEmitter.on('newtracks', (data) => {
BrowserWindow.win.webContents.send('getUpdatedLocalList', data);
});
ipcMain.on('writeWAV', (event, leftpcm, rightpcm, bufferlength) => {
function interleave16(leftChannel: any, rightChannel: any) {

View file

@ -5,11 +5,15 @@ import { utils } from '../../base/utils';
import * as mm from 'music-metadata';
import {Md5} from 'ts-md5/dist/md5';
import e from "express";
import { EventEmitter } from 'events';
export class LocalFiles {
static localSongs: any = [];
static localSongsArts: any = [];
public static DB = ProviderDB.db;
static eventEmitter = new EventEmitter();
static getDataType(item_id : String | any){
if ((item_id ?? ('')).startsWith('ciderlocalart'))
@ -105,8 +109,10 @@ export class LocalFiles {
ProviderDB.db.putIfNotExists(form)
ProviderDB.db.putIfNotExists(art)
metadatalist.push(form)
}
//delete removed tracks
if (this.localSongs.length === 0 && numid % 10 === 0) { // send updated chunks only if there is no previous database
this.eventEmitter.emit('newtracks', metadatalist)}
}
} catch (e) { }
}
this.localSongs = metadatalist;

View file

@ -139,7 +139,6 @@
</div>
</div>
</template>
</div>
</div>
<div class="col right-col" v-if="tabMode != ''">
<!-- <div class="fs-info">

View file

@ -18,6 +18,24 @@
<span>{{$root.getLz('settings.header.general')}}</span>
</div>
<div class="settings-option-body">
<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="app.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 class="md-option-line">
<div class="md-option-segment">
{{$root.getLz('term.accountSettings')}}
@ -1317,24 +1335,6 @@
</div>
</div>
<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="app.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 class="md-option-line update-check" v-if="app.platform === 'win32'">
<div class="md-option-segment">
{{$root.getLz('settings.option.visual.transparent')}}<br>