2022-02-26 23:19:22 +01:00
|
|
|
const SupportedFileTypes = {
|
|
|
|
image: ['png', 'jpg', 'jpeg', 'webp'],
|
2023-06-05 23:23:40 +02:00
|
|
|
audio: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'ogg', 'oga', 'mp4', 'aac', 'wma', 'aiff', 'wav', 'webm', 'webma', 'mka', 'awb', 'caf'],
|
2022-02-26 23:19:22 +01:00
|
|
|
ebook: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz'],
|
|
|
|
info: ['nfo'],
|
|
|
|
text: ['txt'],
|
2023-05-27 23:00:34 +02:00
|
|
|
metadata: ['opf', 'abs', 'xml', 'json']
|
2022-02-26 23:19:22 +01:00
|
|
|
}
|
|
|
|
|
2021-09-15 03:45:00 +02:00
|
|
|
const DownloadStatus = {
|
|
|
|
PENDING: 0,
|
|
|
|
READY: 1,
|
|
|
|
EXPIRED: 2,
|
|
|
|
FAILED: 3
|
|
|
|
}
|
|
|
|
|
2021-12-02 22:49:03 +01:00
|
|
|
const BookCoverAspectRatio = {
|
|
|
|
STANDARD: 0,
|
|
|
|
SQUARE: 1
|
|
|
|
}
|
|
|
|
|
2021-12-28 22:50:17 +01:00
|
|
|
const BookshelfView = {
|
|
|
|
STANDARD: 0,
|
2022-10-22 16:13:20 +02:00
|
|
|
DETAIL: 1,
|
2022-05-09 01:54:41 +02:00
|
|
|
AUTHOR: 2 // Books shown on author page
|
2021-12-28 22:50:17 +01:00
|
|
|
}
|
|
|
|
|
2022-03-18 01:10:47 +01:00
|
|
|
const PlayMethod = {
|
|
|
|
DIRECTPLAY: 0,
|
|
|
|
DIRECTSTREAM: 1,
|
2022-05-27 02:09:46 +02:00
|
|
|
TRANSCODE: 2,
|
|
|
|
LOCAL: 3
|
2022-03-18 01:10:47 +01:00
|
|
|
}
|
|
|
|
|
2021-09-15 03:45:00 +02:00
|
|
|
const Constants = {
|
2022-02-26 23:19:22 +01:00
|
|
|
SupportedFileTypes,
|
2021-10-02 03:29:00 +02:00
|
|
|
DownloadStatus,
|
2021-12-28 22:50:17 +01:00
|
|
|
BookCoverAspectRatio,
|
2022-03-18 01:10:47 +01:00
|
|
|
BookshelfView,
|
|
|
|
PlayMethod
|
2021-09-15 03:45:00 +02:00
|
|
|
}
|
|
|
|
|
2021-10-23 23:49:34 +02:00
|
|
|
const KeyNames = {
|
|
|
|
27: 'Escape',
|
|
|
|
32: 'Space',
|
|
|
|
37: 'ArrowLeft',
|
|
|
|
38: 'ArrowUp',
|
|
|
|
39: 'ArrowRight',
|
|
|
|
40: 'ArrowDown',
|
|
|
|
76: 'KeyL',
|
|
|
|
77: 'KeyM'
|
2021-10-23 03:08:02 +02:00
|
|
|
}
|
2021-10-24 21:02:49 +02:00
|
|
|
const Hotkeys = {
|
|
|
|
AudioPlayer: {
|
|
|
|
PLAY_PAUSE: 'Space',
|
|
|
|
JUMP_FORWARD: 'ArrowRight',
|
|
|
|
JUMP_BACKWARD: 'ArrowLeft',
|
|
|
|
VOLUME_UP: 'ArrowUp',
|
|
|
|
VOLUME_DOWN: 'ArrowDown',
|
|
|
|
MUTE_UNMUTE: 'KeyM',
|
|
|
|
SHOW_CHAPTERS: 'KeyL',
|
|
|
|
INCREASE_PLAYBACK_RATE: 'Shift-ArrowUp',
|
|
|
|
DECREASE_PLAYBACK_RATE: 'Shift-ArrowDown',
|
|
|
|
CLOSE: 'Escape'
|
|
|
|
},
|
|
|
|
EReader: {
|
|
|
|
NEXT_PAGE: 'ArrowRight',
|
|
|
|
PREV_PAGE: 'ArrowLeft',
|
|
|
|
CLOSE: 'Escape'
|
|
|
|
},
|
|
|
|
Modal: {
|
|
|
|
NEXT_PAGE: 'ArrowRight',
|
|
|
|
PREV_PAGE: 'ArrowLeft',
|
|
|
|
CLOSE: 'Escape'
|
|
|
|
}
|
|
|
|
}
|
2021-10-23 03:08:02 +02:00
|
|
|
|
2022-08-14 01:18:42 +02:00
|
|
|
export {
|
|
|
|
Constants
|
|
|
|
}
|
2021-09-15 03:45:00 +02:00
|
|
|
export default ({ app }, inject) => {
|
|
|
|
inject('constants', Constants)
|
2021-10-23 23:49:34 +02:00
|
|
|
inject('keynames', KeyNames)
|
2021-10-24 21:02:49 +02:00
|
|
|
inject('hotkeys', Hotkeys)
|
2021-09-15 03:45:00 +02:00
|
|
|
}
|