Expose more local files metadata + fix norm error
This commit is contained in:
parent
4759d809f4
commit
eca84c4849
2 changed files with 15 additions and 6 deletions
|
@ -51,7 +51,7 @@ export class LocalFiles {
|
|||
let metadatalist = []
|
||||
let metadatalistart = []
|
||||
let numid = 0;
|
||||
|
||||
|
||||
for (var audio of audiofiles) {
|
||||
try {
|
||||
const metadata = await mm.parseFile(audio);
|
||||
|
@ -89,7 +89,7 @@ export class LocalFiles {
|
|||
"assetUrl": "file:///" + audio,
|
||||
"contentAdvisory": "",
|
||||
"releaseDateTime": `${metadata?.common?.year ?? '2022'}-05-13T00:23:00Z`,
|
||||
"durationInMillis": Math.floor((metadata.format.duration ?? 0) * 1000),
|
||||
"durationInMillis": Math.floor((metadata.format.duration ?? 0) * 1000),
|
||||
"bitrate": Math.floor((metadata.format?.bitrate ?? 0) / 1000),
|
||||
"offers": [
|
||||
{
|
||||
|
@ -100,6 +100,12 @@ export class LocalFiles {
|
|||
"contentRating": "clean"
|
||||
},
|
||||
flavor: Math.floor((metadata.format?.bitrate ?? 0) / 1000),
|
||||
localFilesMetadata: {
|
||||
lossless: metadata.format?.lossless,
|
||||
container: metadata.format?.container,
|
||||
bitDepth: metadata.format?.bitsPerSample ?? 0,
|
||||
sampleRate: metadata.format?.sampleRate ?? 0,
|
||||
},
|
||||
};
|
||||
let art = {
|
||||
id: "ciderlocal" + lochash,
|
||||
|
|
|
@ -969,12 +969,12 @@ const app = new Vue({
|
|||
localStorage.setItem("playingBitrate", app.mk.nowPlayingItem.flavor)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
localStorage.setItem("playingBitrate", "256")
|
||||
localFiles = true;
|
||||
localStorage.setItem("playingBitrate", app.mk.nowPlayingItem.flavor)
|
||||
}
|
||||
if (!app.cfg.audio.normalization) { CiderAudio.hierarchical_loading(); }
|
||||
|
||||
if (app.cfg.audio.normalization) {
|
||||
else {
|
||||
// get unencrypted audio previews to get SoundCheck's normalization tag
|
||||
try {
|
||||
let previewURL = null
|
||||
|
@ -988,11 +988,14 @@ const app = new Vue({
|
|||
}
|
||||
if (previewURL == null && ((app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)) != -1)) {
|
||||
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/songs/${app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)}`).then((response) => {
|
||||
previewURL = response.data.data[0].attributes.previews[0].url
|
||||
previewURL = response.data.data[0].attributes.previews[0].url ?? false;
|
||||
if (previewURL) {
|
||||
console.debug("[Cider][MaikiwiSoundCheck] previewURL response.data.data[0].attributes.previews[0].url: " + previewURL)
|
||||
ipcRenderer.send('getPreviewURL', previewURL)
|
||||
}
|
||||
else {
|
||||
if (localFiles === true) {CiderAudio.audioNodes.gainNode.gain = 0.8222426499470}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (previewURL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue