Add constructor capitalization rule

This commit is contained in:
Bill Thornton 2023-07-06 11:49:55 -04:00
parent 8e2ea6812a
commit ec0adb895b
43 changed files with 103 additions and 94 deletions

View File

@ -35,9 +35,15 @@ module.exports = {
'indent': ['error', 4, { 'SwitchCase': 1 }],
'jsx-quotes': ['error', 'prefer-single'],
'keyword-spacing': ['error'],
'no-throw-literal': ['error'],
'max-statements-per-line': ['error'],
'max-params': ['error', 7],
'new-cap': [
'error',
{
'capIsNewExceptions': ['jQuery.Deferred'],
'newIsCapExceptionPattern': '\\.default$'
}
],
'no-duplicate-imports': ['error'],
'no-empty-function': ['error'],
'no-floating-decimal': ['error'],
@ -52,6 +58,7 @@ module.exports = {
'no-sequences': ['error', { 'allowInParentheses': false }],
'no-shadow': ['off'],
'@typescript-eslint/no-shadow': ['error'],
'no-throw-literal': ['error'],
'no-trailing-spaces': ['error'],
'no-unused-expressions': ['off'],
'@typescript-eslint/no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }],

View File

@ -65,12 +65,12 @@ const Home: FunctionComponent = () => {
depends = 'favorites';
}
return import(/* webpackChunkName: "[request]" */ `../../../controllers/${depends}`).then(({ default: controllerFactory }) => {
return import(/* webpackChunkName: "[request]" */ `../../../controllers/${depends}`).then(({ default: ControllerFactory }) => {
let controller = tabControllers[index];
if (!controller) {
const tabContent = element.current?.querySelector(".tabContent[data-index='" + index + "']");
controller = new controllerFactory(tabContent, null);
controller = new ControllerFactory(tabContent, null);
tabControllers[index] = controller;
}

View File

@ -9,7 +9,7 @@ function render() {
return elem;
}
class appFooter {
class AppFooter {
constructor() {
const self = this;
@ -33,4 +33,4 @@ class appFooter {
}
}
export default new appFooter();
export default new AppFooter();

View File

@ -12,7 +12,7 @@ import 'material-design-icons-iconfont';
import '../formdialog.scss';
import ServerConnections from '../ServerConnections';
export default class channelMapper {
export default class ChannelMapper {
constructor(options) {
function mapChannel(button, channelId, providerChannelId) {
loading.show();

View File

@ -345,8 +345,8 @@ function executeCommand(item, id, options) {
});
break;
case 'addtoplaylist':
import('./playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
new playlistEditor({
import('./playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
new PlaylistEditor({
items: [itemId],
serverId: serverId
}).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
@ -630,8 +630,8 @@ function deleteItem(apiClient, item) {
}
function refresh(apiClient, item) {
import('./refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
new refreshDialog({
import('./refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
new RefreshDialog({
itemIds: [item.Id],
serverId: apiClient.serverInfo().Id,
mode: item.Type === 'CollectionFolder' ? 'scan' : null

View File

@ -188,7 +188,7 @@ function initLibraryOptions(dlg) {
});
}
export class showEditor {
export class MediaLibraryCreator {
constructor(options) {
return new Promise((resolve) => {
currentOptions = options;
@ -224,4 +224,4 @@ let currentOptions;
let hasChanges = false;
let isCreating = false;
export default showEditor;
export default MediaLibraryCreator;

View File

@ -197,7 +197,7 @@ function onDialogClosed() {
currentDeferred.resolveWith(null, [hasChanges]);
}
export class showEditor {
export class MediaLibraryEditor {
constructor(options) {
const deferred = jQuery.Deferred();
currentOptions = options;
@ -231,4 +231,4 @@ let currentOptions;
let hasChanges = false;
let isCreating = false;
export default showEditor;
export default MediaLibraryEditor;

View File

@ -6,7 +6,7 @@ import dom from '../../scripts/dom';
import './multiSelect.scss';
import ServerConnections from '../ServerConnections';
import alert from '../alert';
import playlistEditor from '../playlisteditor/playlisteditor';
import PlaylistEditor from '../playlisteditor/playlisteditor';
import confirm from '../confirm/confirm';
import itemHelper from '../itemHelper';
import datetime from '../../scripts/datetime';
@ -269,7 +269,7 @@ function showMenuForSelectedItems(e) {
dispatchNeedsRefresh();
break;
case 'playlist':
new playlistEditor({
new PlaylistEditor({
items: items,
serverId: serverId
});
@ -299,8 +299,8 @@ function showMenuForSelectedItems(e) {
dispatchNeedsRefresh();
break;
case 'refresh':
import('../refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
new refreshDialog({
import('../refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
new RefreshDialog({
itemIds: items,
serverId: serverId
}).show();

View File

@ -221,7 +221,7 @@ function centerFocus(elem, horiz, on) {
});
}
export class showEditor {
export class PlaylistEditor {
constructor(options) {
const items = options.items || {};
currentServerId = options.serverId;
@ -280,4 +280,4 @@ export class showEditor {
}
}
export default showEditor;
export default PlaylistEditor;

View File

@ -72,13 +72,13 @@ class PluginManager {
throw new TypeError('Plugin definitions in window have to be an (async) function returning the plugin class');
}
const pluginClass = await pluginDefinition();
if (typeof pluginClass !== 'function') {
const PluginClass = await pluginDefinition();
if (typeof PluginClass !== 'function') {
throw new TypeError(`Plugin definition doesn't return a class for '${pluginSpec}'`);
}
// init plugin and pass basic dependencies
plugin = new pluginClass({
plugin = new PluginClass({
events: Events,
loading,
appSettings,

View File

@ -6,7 +6,7 @@ import loading from '../loading/loading';
import scrollHelper from '../../scripts/scrollHelper';
import datetime from '../../scripts/datetime';
import imageLoader from '../images/imageLoader';
import recordingFields from './recordingfields';
import RecordingFields from './recordingfields';
import Events from '../../utils/events.ts';
import '../../elements/emby-button/emby-button';
import '../../elements/emby-button/paper-icon-button-light';
@ -185,7 +185,7 @@ function showEditor(itemId, serverId) {
reload(dlg, itemId, serverId);
currentRecordingFields = new recordingFields({
currentRecordingFields = new RecordingFields({
parent: dlg.querySelector('.recordingFields'),
programId: itemId,
serverId: serverId

View File

@ -691,10 +691,10 @@ export default function () {
}
function savePlaylist() {
import('../playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
import('../playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
getSaveablePlaylistItems().then(function (items) {
const serverId = items.length ? items[0].ServerId : ApiClient.serverId();
new playlistEditor({
new PlaylistEditor({
items: items.map(function (i) {
return i.Id;
}),

View File

@ -270,8 +270,8 @@ function executeAction(card, target, action) {
}
function addToPlaylist(item) {
import('./playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
new playlistEditor().show({
import('./playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
new PlaylistEditor().show({
items: [item.Id],
serverId: item.ServerId

View File

@ -120,7 +120,7 @@ function discoverDevices(view) {
});
}
function tunerPicker() {
function TunerPicker() {
this.show = function () {
const dialogOptions = {
removeOnClose: true,
@ -182,4 +182,4 @@ function tunerPicker() {
let currentDevices = [];
export default tunerPicker;
export default TunerPicker;

View File

@ -21,6 +21,7 @@ viewContainer.setOnBeforeChange(function (newView, isRestored, options) {
newView.initComplete = true;
if (typeof options.controllerFactory === 'function') {
// eslint-disable-next-line new-cap
new options.controllerFactory(newView, eventDetail.detail.params);
} else if (options.controllerFactory && typeof options.controllerFactory.default === 'function') {
new options.controllerFactory.default(newView, eventDetail.detail.params);

View File

@ -13,8 +13,8 @@ import confirm from '../../components/confirm/confirm';
import cardBuilder from '../../components/cardbuilder/cardBuilder';
function addVirtualFolder(page) {
import('../../components/mediaLibraryCreator/mediaLibraryCreator').then(({ default: medialibrarycreator }) => {
new medialibrarycreator({
import('../../components/mediaLibraryCreator/mediaLibraryCreator').then(({ default: MediaLibraryCreator }) => {
new MediaLibraryCreator({
collectionTypeOptions: getCollectionTypeOptions().filter(function (f) {
return !f.hidden;
}),
@ -28,8 +28,8 @@ function addVirtualFolder(page) {
}
function editVirtualFolder(page, virtualFolder) {
import('../../components/mediaLibraryEditor/mediaLibraryEditor').then(({ default: medialibraryeditor }) => {
new medialibraryeditor({
import('../../components/mediaLibraryEditor/mediaLibraryEditor').then(({ default: MediaLibraryEditor }) => {
new MediaLibraryEditor({
refresh: shouldRefreshLibraryAfterChanges(page),
library: virtualFolder
}).then(function (hasChanges) {
@ -62,8 +62,8 @@ function deleteVirtualFolder(page, virtualFolder) {
}
function refreshVirtualFolder(page, virtualFolder) {
import('../../components/refreshdialog/refreshdialog').then(({ default: refreshDialog }) => {
new refreshDialog({
import('../../components/refreshdialog/refreshdialog').then(({ default: RefreshDialog }) => {
new RefreshDialog({
itemIds: [virtualFolder.ItemId],
serverId: ApiClient.serverId(),
mode: 'scan'

View File

@ -49,11 +49,11 @@ class HomeView extends TabbedView {
}
const instance = this;
return import(/* webpackChunkName: "[request]" */ `../controllers/${depends}`).then(({ default: controllerFactory }) => {
return import(/* webpackChunkName: "[request]" */ `../controllers/${depends}`).then(({ default: ControllerFactory }) => {
let controller = instance.tabControllers[index];
if (!controller) {
controller = new controllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params);
controller = new ControllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params);
instance.tabControllers[index] = controller;
}

View File

@ -691,8 +691,8 @@ function showRecordingFields(instance, page, item, user) {
const recordingFieldsElement = page.querySelector('.recordingFields');
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
import('../../components/recordingcreator/recordingfields').then(({ default: recordingFields }) => {
instance.currentRecordingFields = new recordingFields({
import('../../components/recordingcreator/recordingfields').then(({ default: RecordingFields }) => {
instance.currentRecordingFields = new RecordingFields({
parent: recordingFieldsElement,
programId: item.Id,
serverId: item.ServerId
@ -1826,7 +1826,7 @@ function renderCast(page, item) {
});
}
function itemDetailPage() {
function ItemDetailPage() {
const self = this;
self.setInitialCollapsibleState = setInitialCollapsibleState;
self.renderDetails = renderDetails;
@ -1846,7 +1846,7 @@ function onTrackSelectionsSubmit(e) {
return false;
}
window.ItemDetailPage = new itemDetailPage();
window.ItemDetailPage = new ItemDetailPage();
export default function (view, params) {
function getApiClient() {

View File

@ -399,8 +399,8 @@ function showSortMenu() {
function onNewItemClick() {
const instance = this;
import('../components/playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
new playlistEditor({
import('../components/playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
new PlaylistEditor({
items: [],
serverId: instance.params.serverId
});

View File

@ -1,4 +1,4 @@
import tvguide from '../../components/guide/guide';
import Guide from '../../components/guide/guide';
export default function (view, params, tabContent) {
let guideInstance;
@ -6,7 +6,7 @@ export default function (view, params, tabContent) {
self.renderTab = function () {
if (!guideInstance) {
guideInstance = new tvguide({
guideInstance = new Guide({
element: tabContent,
serverId: ApiClient.serverId()
});

View File

@ -274,7 +274,7 @@ export default function (view, params) {
break;
}
import(`../livetv/${depends}`).then(({ default: controllerFactory }) => {
import(`../livetv/${depends}`).then(({ default: ControllerFactory }) => {
let tabContent;
if (index === 0) {
@ -290,7 +290,7 @@ export default function (view, params) {
if (index === 0) {
controller = self;
} else {
controller = new controllerFactory(view, params, tabContent);
controller = new ControllerFactory(view, params, tabContent);
}
tabControllers[index] = controller;

View File

@ -9,8 +9,8 @@ function onListingsSubmitted() {
}
function init(page, type, providerId) {
import(`../components/tvproviders/${type}`).then(({ default: factory }) => {
const instance = new factory(page, providerId, {});
import(`../components/tvproviders/${type}`).then(({ default: ProviderFactory }) => {
const instance = new ProviderFactory(page, providerId, {});
Events.on(instance, 'submitted', onListingsSubmitted);
instance.init();
});

View File

@ -165,8 +165,8 @@ function showProviderOptions(page, providerId, button) {
}
function mapChannels(page, providerId) {
import('../components/channelMapper/channelMapper').then(({ default: channelMapper }) => {
new channelMapper({
import('../components/channelMapper/channelMapper').then(({ default: ChannelMapper }) => {
new ChannelMapper({
serverId: ApiClient.serverInfo().Id,
providerId: providerId
}).show();

View File

@ -106,8 +106,8 @@ function submitForm(page) {
}
function getDetectedDevice() {
return import('../components/tunerPicker').then(({ default: tunerPicker }) => {
return new tunerPicker().show({
return import('../components/tunerPicker').then(({ default: TunerPicker }) => {
return new TunerPicker().show({
serverId: ApiClient.serverId()
});
});

View File

@ -289,8 +289,8 @@ export default function (view, params, tabContent, options) {
query = userSettings.loadQuerySettings(savedQueryKey, query);
this.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: query,
mode: 'movies',
serverId: ApiClient.serverId()

View File

@ -314,7 +314,7 @@ export default function (view, params) {
break;
}
import(`../movies/${depends}`).then(({ default: controllerFactory }) => {
import(`../movies/${depends}`).then(({ default: ControllerFactory }) => {
let tabContent;
if (index === suggestionsTabIndex) {
@ -330,11 +330,11 @@ export default function (view, params) {
if (index === suggestionsTabIndex) {
controller = this;
} else if (index == 0 || index == 3) {
controller = new controllerFactory(view, params, tabContent, {
controller = new ControllerFactory(view, params, tabContent, {
mode: index ? 'favorites' : 'movies'
});
} else {
controller = new controllerFactory(view, params, tabContent);
controller = new ControllerFactory(view, params, tabContent);
}
tabControllers[index] = controller;

View File

@ -182,8 +182,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
this.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(),
mode: 'movies',
serverId: ApiClient.serverId()

View File

@ -189,8 +189,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
this.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(),
mode: 'albums',
serverId: ApiClient.serverId()

View File

@ -170,8 +170,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
this.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(tabContent),
mode: this.mode,
serverId: ApiClient.serverId()

View File

@ -290,7 +290,7 @@ export default function (view, params) {
break;
}
import(`../music/${depends}`).then(({ default: controllerFactory }) => {
import(`../music/${depends}`).then(({ default: ControllerFactory }) => {
let tabContent;
if (index == 1) {
@ -306,7 +306,7 @@ export default function (view, params) {
if (index === 1) {
controller = this;
} else {
controller = new controllerFactory(view, params, tabContent);
controller = new ControllerFactory(view, params, tabContent);
}
if (index == 2) {

View File

@ -135,8 +135,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
self.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(tabContent),
mode: 'songs',
serverId: ApiClient.serverId()

View File

@ -1,9 +1,9 @@
import remotecontrolFactory from '../../../components/remotecontrol/remotecontrol';
import RemoteControl from '../../../components/remotecontrol/remotecontrol';
import libraryMenu from '../../../scripts/libraryMenu';
import '../../../elements/emby-button/emby-button';
export default function (view) {
const remoteControl = new remotecontrolFactory();
const remoteControl = new RemoteControl();
remoteControl.init(view, view.querySelector('.remoteControlContent'));
view.addEventListener('viewshow', function () {
libraryMenu.setTransparentMenu(true);

View File

@ -171,8 +171,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
self.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(tabContent),
mode: 'episodes',
serverId: ApiClient.serverId()

View File

@ -268,7 +268,7 @@ export default function (view, params) {
break;
}
import(`../shows/${depends}`).then(({ default: controllerFactory }) => {
import(`../shows/${depends}`).then(({ default: ControllerFactory }) => {
let tabContent;
if (index === 1) {
@ -284,7 +284,7 @@ export default function (view, params) {
if (index === 1) {
controller = self;
} else {
controller = new controllerFactory(view, params, tabContent);
controller = new ControllerFactory(view, params, tabContent);
}
tabControllers[index] = controller;

View File

@ -199,8 +199,8 @@ export default function (view, params, tabContent) {
let isLoading = false;
this.showFilterMenu = function () {
import('../../components/filterdialog/filterdialog').then(({ default: filterDialogFactory }) => {
const filterDialog = new filterDialogFactory({
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
const filterDialog = new FilterDialog({
query: getQuery(tabContent),
mode: 'series',
serverId: ApiClient.serverId()

View File

@ -5,7 +5,7 @@ import layoutManager from '../../components/layoutManager';
import dom from '../../scripts/dom';
import browser from '../../scripts/browser';
import focusManager from '../../components/focusManager';
import scrollerFactory from '../../libraries/scroller';
import ScrollerFactory from '../../libraries/scroller';
import ScrollButtons from '../emby-scrollbuttons/ScrollButtons';
import './emby-scroller.scss';
@ -41,7 +41,7 @@ const Scroller: FC<ScrollerProps> = ({
scrollPos: 0,
scrollWidth: 0
});
const scrollerFactoryRef = useRef<scrollerFactory | null>(null);
const scrollerFactoryRef = useRef<ScrollerFactory | null>(null);
const getScrollSlider = useCallback(() => {
if (scrollerFactoryRef.current) {
@ -126,7 +126,7 @@ const Scroller: FC<ScrollerProps> = ({
});
}, [getScrollPosition, getScrollSize, getScrollWidth]);
const initCenterFocus = useCallback((elem, scrollerInstance: scrollerFactory) => {
const initCenterFocus = useCallback((elem, scrollerInstance: ScrollerFactory) => {
dom.addEventListener(elem, 'focus', function (e: FocusEvent) {
const focused = focusManager.focusableParent(e.target);
if (focused) {
@ -179,7 +179,7 @@ const Scroller: FC<ScrollerProps> = ({
};
// If just inserted it might not have any height yet - yes this is a hack
scrollerFactoryRef.current = new scrollerFactory(scrollRef.current, options);
scrollerFactoryRef.current = new ScrollerFactory(scrollRef.current, options);
scrollerFactoryRef.current.init();
scrollerFactoryRef.current.reload();

View File

@ -1,4 +1,4 @@
import scroller from '../../libraries/scroller';
import ScrollerFactory from '../../libraries/scroller';
import dom from '../../scripts/dom';
import layoutManager from '../../components/layoutManager';
import inputManager from '../../scripts/inputManager';
@ -140,7 +140,7 @@ ScrollerPrototype.attachedCallback = function () {
};
// If just inserted it might not have any height yet - yes this is a hack
this.scroller = new scroller(scrollFrame, options);
this.scroller = new ScrollerFactory(scrollFrame, options);
this.scroller.init();
this.scroller.reload();

View File

@ -1,6 +1,6 @@
import 'webcomponents.js/webcomponents-lite';
import dom from '../../scripts/dom';
import scroller from '../../libraries/scroller';
import ScrollerFactory from '../../libraries/scroller';
import browser from '../../scripts/browser';
import focusManager from '../../components/focusManager';
import layoutManager from '../../components/layoutManager';
@ -124,7 +124,7 @@ function initScroller(tabs) {
const contentScrollSlider = tabs.querySelector('.emby-tabs-slider');
if (contentScrollSlider) {
tabs.scroller = new scroller(tabs, {
tabs.scroller = new ScrollerFactory(tabs, {
horizontal: 1,
itemNav: 0,
mouseDragging: 1,

View File

@ -19,7 +19,7 @@ function calculateOffset(textarea) {
return offset;
}
function autoGrow(textarea, maxLines) {
function AutoGrow(textarea, maxLines) {
const self = this;
if (maxLines === undefined) {
@ -125,7 +125,7 @@ EmbyTextAreaPrototype.attachedCallback = function () {
label.innerText = text;
};
new autoGrow(this);
new AutoGrow(this);
};
document.registerElement('emby-textarea', {

View File

@ -904,6 +904,7 @@ scrollerFactory.prototype.toCenter = function (item, immediate) {
};
scrollerFactory.create = function (frame, options) {
// eslint-disable-next-line new-cap
const instance = new scrollerFactory(frame, options);
return Promise.resolve(instance);
};

View File

@ -2,7 +2,7 @@ import appSettings from '../../scripts/settings/appSettings';
import * as userSettings from '../../scripts/settings/userSettings';
import { playbackManager } from '../../components/playback/playbackmanager';
import globalize from '../../scripts/globalize';
import castSenderApiLoader from './castSenderApi';
import CastSenderApi from './castSenderApi';
import ServerConnections from '../../components/ServerConnections';
import alert from '../../components/alert';
import { PluginType } from '../../types/plugin.ts';
@ -576,7 +576,7 @@ class ChromecastPlayer {
this.isLocalPlayer = false;
this.lastPlayerData = {};
new castSenderApiLoader().load().then(initializeChromecast.bind(this));
new CastSenderApi().load().then(initializeChromecast.bind(this));
}
tryPair() {

View File

@ -1490,8 +1490,8 @@ export class HtmlVideoPlayer {
// add some cues to show the text
// in safari, the cues need to be added before setting the track mode to showing
for (const trackEvent of data.TrackEvents) {
const trackCueObject = window.VTTCue || window.TextTrackCue;
const cue = new trackCueObject(trackEvent.StartPositionTicks / 10000000, trackEvent.EndPositionTicks / 10000000, normalizeTrackEventText(trackEvent.Text, false));
const TrackCue = window.VTTCue || window.TextTrackCue;
const cue = new TrackCue(trackEvent.StartPositionTicks / 10000000, trackEvent.EndPositionTicks / 10000000, normalizeTrackEventText(trackEvent.Text, false));
if (cue.line === 'auto') {
cue.line = cueLine;

View File

@ -189,9 +189,9 @@ export default function (view) {
reloadItems();
});
view.querySelector('.btnNewPlaylist').addEventListener('click', function () {
import('../components/playlisteditor/playlisteditor').then(({ default: playlistEditor }) => {
import('../components/playlisteditor/playlisteditor').then(({ default: PlaylistEditor }) => {
const serverId = ApiClient.serverInfo().Id;
new playlistEditor({
new PlaylistEditor({
items: [],
serverId: serverId
});