Skip to content

Commit

Permalink
Remove last references to IntroEditor
Browse files Browse the repository at this point in the history
Finally get around to ensuring everything references MarkerEditor
instead of IntroEditor.
  • Loading branch information
danrahn committed Oct 9, 2023
1 parent 61b336d commit 1665375
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"type": "node",
"request": "launch",
"name": "Launch IntroEditor",
"name": "Launch MarkerEditor",
"skipFiles": [
"<node_internals>/**"
],
Expand Down
2 changes: 1 addition & 1 deletion Build/build-win.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function toExe() {
}

/**
* Full pipeline to create IntroEditorForPlex.exe. */
* Full pipeline to create MarkerEditorForPlex.exe. */
async function buildWin() {
const msg = (m) => console.log(`\n${m}...`);
msg('Removing Previous dist folder');
Expand Down
2 changes: 1 addition & 1 deletion Client/Script/HelpOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const helpText = appendChildren(
buildNode('h1', {}, 'Welcome to Marker Editor for Plex'),
buildNode('p', {}, `
For help with the configuration and usage of ths app, see the
<a href="https://github.com/danrahn/IntroEditorForPlex/wiki" target="_blank" rel="noreferrer">wiki on GitHub</a>.`),
<a href="https://github.com/danrahn/MarkerEditorForPlex/wiki" target="_blank" rel="noreferrer">wiki on GitHub</a>.`),
buildNode('p', { style : 'margin-top: 30px' }, `
Disclaimer: This interacts directly with your Plex database in a way that is not officially supported. While it should
be safe to perform various create/update/delete actions, there are no guarantees that it won't break things now or in
Expand Down
2 changes: 1 addition & 1 deletion Client/Script/VersionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class VersionManager {
return;
}

const releaseUrl = `https://api.github.com/repos/danrahn/IntroEditorForPlex/releases`;
const releaseUrl = `https://api.github.com/repos/danrahn/MarkerEditorForPlex/releases`;
const headers = { accept : `application/vnd.github+json` };
try {
/** @type {any[]} */
Expand Down
2 changes: 1 addition & 1 deletion Server/Commands/GeneralCommands.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConsoleLog, ContextualLog } from '../../Shared/ConsoleLog.js';

import { Config } from '../IntroEditorConfig.js';
import { Config } from '../MarkerEditorConfig.js';
import ServerError from '../ServerError.js';


Expand Down
2 changes: 1 addition & 1 deletion Server/Commands/QueryCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EpisodeData, MarkerData, MovieData, SeasonData, SectionType, ShowData }
import { MarkerType, supportedMarkerType } from '../../Shared/MarkerType.js';
import { ContextualLog } from '../../Shared/ConsoleLog.js';

import { Config } from '../IntroEditorConfig.js';
import { Config } from '../MarkerEditorConfig.js';
import LegacyMarkerBreakdown from '../LegacyMarkerBreakdown.js';
import { MarkerCache } from '../MarkerCacheManager.js';
import { PlexQueries } from '../PlexQueryManager.js';
Expand Down
6 changes: 3 additions & 3 deletions Server/FirstRunConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { join } from 'path';

import { ContextualLog } from '../Shared/ConsoleLog.js';

import { IntroEditorConfig } from './IntroEditorConfig.js';
import { MarkerEditorConfig } from './MarkerEditorConfig.js';
import { testFfmpeg } from './ServerHelpers.js';


Expand Down Expand Up @@ -47,7 +47,7 @@ async function FirstRunConfig(dataRoot) {
console.log('If you are asked to provide a path, provide it without quotes or other escaped characters.');
console.log();
/* eslint-disable-next-line max-len */
console.log('For more information about what these settings control, see https://github.com/danrahn/IntroEditorForPlex/wiki/Configuration');
console.log('For more information about what these settings control, see https://github.com/danrahn/MarkerEditorForPlex/wiki/Configuration');
console.log();
await rl.question('Press Enter to continue to configuration (Ctrl+C to cancel at any point): ');
console.log();
Expand All @@ -62,7 +62,7 @@ async function FirstRunConfig(dataRoot) {
config.host = '0.0.0.0';
config.port = 3232;
} else {
const defaultPath = IntroEditorConfig.getDefaultPlexDataPath();
const defaultPath = MarkerEditorConfig.getDefaultPlexDataPath();
config.dataPath = await askUserPath('Plex data directory path', rl, defaultPath);
const defaultDb = join(config.dataPath, 'Plug-in Support', 'Databases', 'com.plexapp.plugins.library.db');
config.database = await askUserPath('Plex database path', rl, defaultDb);
Expand Down
2 changes: 1 addition & 1 deletion Server/GETHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { readFileSync } from 'fs';

import { ContextualLog } from '../Shared/ConsoleLog.js';

import { Config, ProjectRoot } from './IntroEditorConfig.js';
import { Config, ProjectRoot } from './MarkerEditorConfig.js';
import { GetServerState, ServerState } from './ServerState.js';
import DatabaseImportExport from './ImportExport.js';
import { sendCompressedData } from './ServerHelpers.js';
Expand Down
2 changes: 1 addition & 1 deletion Server/ImportExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import DatabaseWrapper from './DatabaseWrapper.js';
import LegacyMarkerBreakdown from './LegacyMarkerBreakdown.js';
import { MarkerCacheManager } from './MarkerCacheManager.js';
import MarkerEditCache from './MarkerEditCache.js';
import { ProjectRoot } from './IntroEditorConfig.js';
import { ProjectRoot } from './MarkerEditorConfig.js';
import ServerError from './ServerError.js';
import TransactionBuilder from './TransactionBuilder.js';

Expand Down
2 changes: 1 addition & 1 deletion Server/MarkerBackupManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ContextualLog } from '../Shared/ConsoleLog.js';
// Server dependencies/typedefs
import { ExtraData, MetadataType, PlexQueries } from './PlexQueryManager.js';
import { MarkerEnum, MarkerType } from '../Shared/MarkerType.js';
import { Config } from './IntroEditorConfig.js';
import { Config } from './MarkerEditorConfig.js';
import DatabaseWrapper from './DatabaseWrapper.js';
import { MarkerCache } from './MarkerCacheManager.js';
import MarkerEditCache from './MarkerEditCache.js';
Expand Down
12 changes: 6 additions & 6 deletions Server/IntroEditor.js → Server/MarkerEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ContextualLog } from '../Shared/ConsoleLog.js';

/** Server dependencies */
import { BackupManager, MarkerBackupManager } from './MarkerBackupManager.js';
import { Config, IntroEditorConfig, ProjectRoot } from './IntroEditorConfig.js';
import { Config, MarkerEditorConfig, ProjectRoot } from './MarkerEditorConfig.js';
import { GetServerState, ServerState, SetServerState } from './ServerState.js';
import { sendJsonError, sendJsonSuccess } from './ServerHelpers.js';
import DatabaseImportExport from './ImportExport.js';
Expand Down Expand Up @@ -44,7 +44,7 @@ async function run() {
await FirstRunConfig(dataRoot);
}

const config = IntroEditorConfig.Create(testData, dataRoot);
const config = MarkerEditorConfig.Create(testData, dataRoot);

// Set up the database, and make sure it's the right one.
const queryManager = await PlexQueryManager.CreateInstance(config.databasePath());
Expand All @@ -68,8 +68,6 @@ async function run() {
return launchServer();
}

export { run };

/** Set up process listeners that will shut down the process
* when it encounters an unhandled exception or SIGINT. */
function setupTerminateHandlers() {
Expand Down Expand Up @@ -118,7 +116,7 @@ function writeErrorToFile(message) {
const time = `${now.getFullYear()}.${padLeft(now.getMonth() + 1)}.${padLeft(now.getDate())}.` +
`${padLeft(now.getHours())}.${padLeft(now.getMinutes())}.${padLeft(now.getSeconds())}.` +
`${padLeft(now.getMilliseconds(), 3)}`;
const filename = `IntroEditor.${time}.err`;
const filename = `MarkerEditor.${time}.err`;
writeFileSync(join(logDir, filename), message);
Log.verbose(`Wrote error file to ${join(logDir, filename)}`);
} catch (ex) {
Expand Down Expand Up @@ -186,7 +184,7 @@ async function cleanupForShutdown(fullShutdown) {

// Ensure this is always last, as some classes
// above may rely on values here.
IntroEditorConfig.Close();
MarkerEditorConfig.Close();

// Either we failed to resume the server, or we got a shutdown request in the middle of
// resuming. Send a failure response now so the server can close cleanly.
Expand Down Expand Up @@ -447,3 +445,5 @@ function checkTestData() {

return testData;
}

export { run };
20 changes: 10 additions & 10 deletions Server/IntroEditorConfig.js → Server/MarkerEditorConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Log = new ContextualLog('EditorConfig');
* required (i.e. the private method itself uses private members of the base class).
*
* It's not super clean, and probably much easier to just make the base members public, or
* duplicate the code between PlexFeatures and IntroEditorConfig, but where's the fun in that?
* duplicate the code between PlexFeatures and MarkerEditorConfig, but where's the fun in that?
*/
class ConfigBase {
/** The raw configuration file.
Expand Down Expand Up @@ -117,24 +117,24 @@ class PlexFeatures extends ConfigBase {

/**
* Singleton editor config instance.
* @type {IntroEditorConfig}
* @type {MarkerEditorConfig}
* @readonly */ // Externally readonly
let Instance;

/**
* Provides read-only access to the users application configuration.
*/
class IntroEditorConfig extends ConfigBase {
class MarkerEditorConfig extends ConfigBase {
/**
* Create the singleton config instance.
* @param {*} testData
* @param {string} dataRoot The root of the config file, which isn't the same as the project root in Docker. */
static Create(testData, dataRoot) {
if (Instance != null) {
Log.warn(`Singleton IntroEditorConfig already exists, we shouldn't be creating it again!`);
Log.warn(`Singleton MarkerEditorConfig already exists, we shouldn't be creating it again!`);
}

Instance = new IntroEditorConfig(testData, dataRoot);
Instance = new MarkerEditorConfig(testData, dataRoot);
return Instance;
}

Expand Down Expand Up @@ -169,7 +169,7 @@ class IntroEditorConfig extends ConfigBase {
* @type {string} */
#version;

/** Creates a new IntroEditorConfig. */
/** Creates a new MarkerEditorConfig. */
constructor(testData, dataRoot) {
Log.info('Reading configuration...');
const baseClass = {};
Expand Down Expand Up @@ -200,7 +200,7 @@ class IntroEditorConfig extends ConfigBase {
this.#host = '0.0.0.0';
this.#port = 3232;
} else {
this.#dataPath = this.#getOrDefault('dataPath', IntroEditorConfig.getDefaultPlexDataPath());
this.#dataPath = this.#getOrDefault('dataPath', MarkerEditorConfig.getDefaultPlexDataPath());
this.#dbPath = this.#getOrDefault(
'database',
join(this.#dataPath, 'Plug-in Support', 'Databases', 'com.plexapp.plugins.library.db'));
Expand Down Expand Up @@ -298,8 +298,8 @@ let globalProjectRoot = undefined;
/**
* Retrieve the root path of this application.
*
* Doesn't live in IntroEditorConfig directly because it occasionally needs to be
* accessed before IntroEditorConfig is completely set up. */
* Doesn't live in MarkerEditorConfig directly because it occasionally needs to be
* accessed before MarkerEditorConfig is completely set up. */
const ProjectRoot = () => (globalProjectRoot ??= dirname(dirname(fileURLToPath(import.meta.url))));

export { IntroEditorConfig, Instance as Config, ProjectRoot };
export { MarkerEditorConfig, Instance as Config, ProjectRoot };
2 changes: 1 addition & 1 deletion Server/ThumbnailManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { execFileSync } from 'child_process';

import { ContextualLog } from '../Shared/ConsoleLog.js';

import { Config, ProjectRoot } from './IntroEditorConfig.js';
import { Config, ProjectRoot } from './MarkerEditorConfig.js';
import ServerError from './ServerError.js';

/** @typedef {!import('./DatabaseWrapper'.default) DatabaseWrapper} */
Expand Down
2 changes: 1 addition & 1 deletion Test/TestBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BaseLog, ConsoleLog } from '../Shared/ConsoleLog.js';
import { GetServerState, ServerState } from '../Server/ServerState.js';
import DatabaseWrapper from '../Server/DatabaseWrapper.js';
import { ExtraData } from '../Server/PlexQueryManager.js';
import { run as mainRun } from '../Server/IntroEditor.js';
import { run as mainRun } from '../Server/MarkerEditor.js';
import TestHelpers from './TestHelpers.js';
import { TestLog } from './TestRunner.js';

Expand Down
2 changes: 1 addition & 1 deletion Test/TestClasses/ImageTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'path';
import { readdirSync } from 'fs';

import { ProjectRoot } from '../../Server/IntroEditorConfig.js';
import { ProjectRoot } from '../../Server/MarkerEditorConfig.js';

import TestBase from '../TestBase.js';
import TestHelpers from '../TestHelpers.js';
Expand Down
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { run } from './Server/IntroEditor.js';
import { run } from './Server/MarkerEditor.js';
process.title = 'Marker Editor for Plex';
run();

0 comments on commit 1665375

Please sign in to comment.