mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Add support to recognize srt and vtt as subtitles formats on the file table
This commit is contained in:
parent
1a9aaf17a6
commit
2f515cc207
3 changed files with 7 additions and 4 deletions
|
|
@ -4,7 +4,8 @@ const SupportedFileTypes = {
|
||||||
ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
|
ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
|
||||||
info: ['nfo'],
|
info: ['nfo'],
|
||||||
text: ['txt'],
|
text: ['txt'],
|
||||||
metadata: ['opf', 'abs', 'xml', 'json']
|
metadata: ['opf', 'abs', 'xml', 'json'],
|
||||||
|
subtitle: ['srt', 'vtt']
|
||||||
}
|
}
|
||||||
|
|
||||||
const DownloadStatus = {
|
const DownloadStatus = {
|
||||||
|
|
@ -82,4 +83,4 @@ export default ({ app }, inject) => {
|
||||||
inject('constants', Constants)
|
inject('constants', Constants)
|
||||||
inject('keynames', KeyNames)
|
inject('keynames', KeyNames)
|
||||||
inject('hotkeys', Hotkeys)
|
inject('hotkeys', Hotkeys)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ class LibraryFile {
|
||||||
if (globals.SupportedVideoTypes.includes(this.metadata.format)) return 'video'
|
if (globals.SupportedVideoTypes.includes(this.metadata.format)) return 'video'
|
||||||
if (globals.TextFileTypes.includes(this.metadata.format)) return 'text'
|
if (globals.TextFileTypes.includes(this.metadata.format)) return 'text'
|
||||||
if (globals.MetadataFileTypes.includes(this.metadata.format)) return 'metadata'
|
if (globals.MetadataFileTypes.includes(this.metadata.format)) return 'metadata'
|
||||||
|
if (globals.SubtitleFileTypes.includes(this.metadata.format)) return 'subtitle'
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,4 +76,4 @@ class LibraryFile {
|
||||||
this.updatedAt = Date.now()
|
this.updatedAt = Date.now()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = LibraryFile
|
module.exports = LibraryFile
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ const globals = {
|
||||||
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
|
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
|
||||||
SupportedVideoTypes: ['mp4'],
|
SupportedVideoTypes: ['mp4'],
|
||||||
TextFileTypes: ['txt', 'nfo'],
|
TextFileTypes: ['txt', 'nfo'],
|
||||||
MetadataFileTypes: ['opf', 'abs', 'xml', 'json']
|
MetadataFileTypes: ['opf', 'abs', 'xml', 'json'],
|
||||||
|
SubtitleFileTypes: ['srt', 'vtt']
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = globals
|
module.exports = globals
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue