Remove tone scripts & references, rename tone-object endpoint, remove node-tone dependency, remove TONE_PATH env

This commit is contained in:
advplyr 2024-07-06 16:00:48 -05:00
parent 8bdee51798
commit e6b1acfb44
14 changed files with 34 additions and 354 deletions

View file

@ -61,7 +61,7 @@ class AudioMetaTags {
// Track ID3 tag might be "3/10" or just "3"
if (this.tagTrack) {
const trackParts = this.tagTrack.split('/').map(part => Number(part))
const trackParts = this.tagTrack.split('/').map((part) => Number(part))
if (trackParts.length > 0) {
// Fractional track numbers not supported
data.number = !isNaN(trackParts[0]) ? Math.trunc(trackParts[0]) : null
@ -81,7 +81,7 @@ class AudioMetaTags {
}
if (this.tagDisc) {
const discParts = this.tagDisc.split('/').map(p => Number(p))
const discParts = this.tagDisc.split('/').map((p) => Number(p))
if (discParts.length > 0) {
data.number = !isNaN(discParts[0]) ? Math.trunc(discParts[0]) : null
}
@ -93,10 +93,18 @@ class AudioMetaTags {
return data
}
get discNumber() { return this.discNumAndTotal.number }
get discTotal() { return this.discNumAndTotal.total }
get trackNumber() { return this.trackNumAndTotal.number }
get trackTotal() { return this.trackNumAndTotal.total }
get discNumber() {
return this.discNumAndTotal.number
}
get discTotal() {
return this.discNumAndTotal.total
}
get trackNumber() {
return this.trackNumAndTotal.number
}
get trackTotal() {
return this.trackNumAndTotal.total
}
construct(metadata) {
this.tagAlbum = metadata.tagAlbum || null
@ -177,10 +185,6 @@ class AudioMetaTags {
this.tagMusicBrainzArtistId = payload.file_tag_musicbrainz_artistid || null
}
setDataFromTone(tags) {
// TODO: Implement
}
updateData(payload) {
const dataMap = {
tagAlbum: payload.file_tag_album || null,
@ -243,4 +247,4 @@ class AudioMetaTags {
return true
}
}
module.exports = AudioMetaTags
module.exports = AudioMetaTags