mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-07 11:12:45 +02:00
Init sqlite take 2
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Logger = require('../../Logger')
|
||||
const { getId } = require('../../utils/index')
|
||||
const uuidv4 = require("uuid").v4
|
||||
const { checkNamesAreEqual } = require('../../utils/parsers/parseNameString')
|
||||
|
||||
class Author {
|
||||
@@ -53,7 +53,7 @@ class Author {
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
this.id = getId('aut')
|
||||
this.id = uuidv4()
|
||||
this.name = data.name
|
||||
this.description = data.description || null
|
||||
this.asin = data.asin || null
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
const uuidv4 = require("uuid").v4
|
||||
const Path = require('path')
|
||||
const Logger = require('../../Logger')
|
||||
const { getId, cleanStringForSearch, areEquivalent, copyValue } = require('../../utils/index')
|
||||
const { cleanStringForSearch, areEquivalent, copyValue } = require('../../utils/index')
|
||||
const AudioFile = require('../files/AudioFile')
|
||||
const AudioTrack = require('../files/AudioTrack')
|
||||
|
||||
class PodcastEpisode {
|
||||
constructor(episode) {
|
||||
this.libraryItemId = null
|
||||
this.podcastId = null
|
||||
this.id = null
|
||||
this.index = null
|
||||
|
||||
@@ -32,6 +34,7 @@ class PodcastEpisode {
|
||||
|
||||
construct(episode) {
|
||||
this.libraryItemId = episode.libraryItemId
|
||||
this.podcastId = episode.podcastId
|
||||
this.id = episode.id
|
||||
this.index = episode.index
|
||||
this.season = episode.season
|
||||
@@ -54,6 +57,7 @@ class PodcastEpisode {
|
||||
toJSON() {
|
||||
return {
|
||||
libraryItemId: this.libraryItemId,
|
||||
podcastId: this.podcastId,
|
||||
id: this.id,
|
||||
index: this.index,
|
||||
season: this.season,
|
||||
@@ -75,6 +79,7 @@ class PodcastEpisode {
|
||||
toJSONExpanded() {
|
||||
return {
|
||||
libraryItemId: this.libraryItemId,
|
||||
podcastId: this.podcastId,
|
||||
id: this.id,
|
||||
index: this.index,
|
||||
season: this.season,
|
||||
@@ -117,7 +122,7 @@ class PodcastEpisode {
|
||||
}
|
||||
|
||||
setData(data, index = 1) {
|
||||
this.id = getId('ep')
|
||||
this.id = uuidv4()
|
||||
this.index = index
|
||||
this.title = data.title
|
||||
this.subtitle = data.subtitle || ''
|
||||
@@ -133,7 +138,7 @@ class PodcastEpisode {
|
||||
}
|
||||
|
||||
setDataFromAudioFile(audioFile, index) {
|
||||
this.id = getId('ep')
|
||||
this.id = uuidv4()
|
||||
this.audioFile = audioFile
|
||||
this.title = Path.basename(audioFile.metadata.filename, Path.extname(audioFile.metadata.filename))
|
||||
this.index = index
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { getId } = require('../../utils/index')
|
||||
const uuidv4 = require("uuid").v4
|
||||
|
||||
class Series {
|
||||
constructor(series) {
|
||||
@@ -40,7 +40,7 @@ class Series {
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
this.id = getId('ser')
|
||||
this.id = uuidv4()
|
||||
this.name = data.name
|
||||
this.description = data.description || null
|
||||
this.addedAt = Date.now()
|
||||
|
||||
Reference in New Issue
Block a user