chore: Add outputTemplate column to format_profiles schema and app.outp…
- "src/db/schema/content.ts" - "src/types/index.ts" - "src/db/repositories/system-config-repository.ts" - "src/db/repositories/format-profile-repository.ts" - "drizzle/0014_adorable_miek.sql" GSD-Task: S02/T01
This commit is contained in:
parent
61105a74b0
commit
e6371ba196
9 changed files with 1046 additions and 6 deletions
1
drizzle/0014_adorable_miek.sql
Normal file
1
drizzle/0014_adorable_miek.sql
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE `format_profiles` ADD `output_template` text;
|
||||||
1027
drizzle/meta/0014_snapshot.json
Normal file
1027
drizzle/meta/0014_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -99,6 +99,13 @@
|
||||||
"when": 1775279021003,
|
"when": 1775279021003,
|
||||||
"tag": "0013_flat_lady_deathstrike",
|
"tag": "0013_flat_lady_deathstrike",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 14,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1775279888856,
|
||||||
|
"tag": "0014_adorable_miek",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -334,7 +334,7 @@ describe('DownloadService', () => {
|
||||||
containerFormat: 'mkv',
|
containerFormat: 'mkv',
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
};
|
};
|
||||||
|
|
@ -388,7 +388,7 @@ describe('DownloadService', () => {
|
||||||
containerFormat: null,
|
containerFormat: null,
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
};
|
};
|
||||||
|
|
@ -642,7 +642,7 @@ describe('DownloadService', () => {
|
||||||
containerFormat: null,
|
containerFormat: null,
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
};
|
};
|
||||||
|
|
@ -686,7 +686,7 @@ describe('DownloadService', () => {
|
||||||
containerFormat: 'mkv',
|
containerFormat: 'mkv',
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
};
|
};
|
||||||
|
|
@ -738,7 +738,7 @@ describe('DownloadService', () => {
|
||||||
containerFormat: null,
|
containerFormat: null,
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ function makeProfile(overrides: Partial<FormatProfile> = {}): FormatProfile {
|
||||||
containerFormat: 'mp4',
|
containerFormat: 'mp4',
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
subtitleLanguages: null,
|
subtitleLanguages: null,
|
||||||
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null,
|
embedSubtitles: false, embedChapters: false, embedThumbnail: false, sponsorBlockRemove: null, outputTemplate: null,
|
||||||
createdAt: '',
|
createdAt: '',
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
...overrides,
|
...overrides,
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ function mapRow(row: typeof formatProfiles.$inferSelect): FormatProfile {
|
||||||
embedChapters: row.embedChapters,
|
embedChapters: row.embedChapters,
|
||||||
embedThumbnail: row.embedThumbnail,
|
embedThumbnail: row.embedThumbnail,
|
||||||
sponsorBlockRemove: row.sponsorBlockRemove ?? null,
|
sponsorBlockRemove: row.sponsorBlockRemove ?? null,
|
||||||
|
outputTemplate: row.outputTemplate ?? null,
|
||||||
createdAt: row.createdAt,
|
createdAt: row.createdAt,
|
||||||
updatedAt: row.updatedAt,
|
updatedAt: row.updatedAt,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ type Db = LibSQLDatabase<typeof schema>;
|
||||||
|
|
||||||
export const APP_CHECK_INTERVAL = 'app.check_interval';
|
export const APP_CHECK_INTERVAL = 'app.check_interval';
|
||||||
export const APP_CONCURRENT_DOWNLOADS = 'app.concurrent_downloads';
|
export const APP_CONCURRENT_DOWNLOADS = 'app.concurrent_downloads';
|
||||||
|
export const APP_OUTPUT_TEMPLATE = 'app.output_template';
|
||||||
export const YTDLP_LAST_UPDATED = 'ytdlp.last_updated';
|
export const YTDLP_LAST_UPDATED = 'ytdlp.last_updated';
|
||||||
|
|
||||||
// ── Read / Write ──
|
// ── Read / Write ──
|
||||||
|
|
@ -86,6 +87,7 @@ export async function seedAppDefaults(db: Db): Promise<void> {
|
||||||
const defaults: Array<{ key: string; value: string }> = [
|
const defaults: Array<{ key: string; value: string }> = [
|
||||||
{ key: APP_CHECK_INTERVAL, value: appConfig.scheduler.defaultCheckInterval.toString() },
|
{ key: APP_CHECK_INTERVAL, value: appConfig.scheduler.defaultCheckInterval.toString() },
|
||||||
{ key: APP_CONCURRENT_DOWNLOADS, value: appConfig.concurrentDownloads.toString() },
|
{ key: APP_CONCURRENT_DOWNLOADS, value: appConfig.concurrentDownloads.toString() },
|
||||||
|
{ key: APP_OUTPUT_TEMPLATE, value: '{platform}/{channel}/{title}.{ext}' },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const { key, value } of defaults) {
|
for (const { key, value } of defaults) {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ export const formatProfiles = sqliteTable('format_profiles', {
|
||||||
embedChapters: integer('embed_chapters', { mode: 'boolean' }).notNull().default(false),
|
embedChapters: integer('embed_chapters', { mode: 'boolean' }).notNull().default(false),
|
||||||
embedThumbnail: integer('embed_thumbnail', { mode: 'boolean' }).notNull().default(false),
|
embedThumbnail: integer('embed_thumbnail', { mode: 'boolean' }).notNull().default(false),
|
||||||
sponsorBlockRemove: text('sponsor_block_remove'), // comma-separated categories: 'sponsor,selfpromo,interaction,intro,outro,preview,music_offtopic,filler'
|
sponsorBlockRemove: text('sponsor_block_remove'), // comma-separated categories: 'sponsor,selfpromo,interaction,intro,outro,preview,music_offtopic,filler'
|
||||||
|
outputTemplate: text('output_template'), // per-profile path template override e.g. '{platform}/{channel}/{title}.{ext}'
|
||||||
createdAt: text('created_at')
|
createdAt: text('created_at')
|
||||||
.notNull()
|
.notNull()
|
||||||
.default(sql`(datetime('now'))`),
|
.default(sql`(datetime('now'))`),
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ export interface FormatProfile {
|
||||||
embedChapters: boolean;
|
embedChapters: boolean;
|
||||||
embedThumbnail: boolean;
|
embedThumbnail: boolean;
|
||||||
sponsorBlockRemove: string | null; // comma-separated: 'sponsor,selfpromo,interaction,intro,outro,preview,music_offtopic,filler'
|
sponsorBlockRemove: string | null; // comma-separated: 'sponsor,selfpromo,interaction,intro,outro,preview,music_offtopic,filler'
|
||||||
|
outputTemplate: string | null; // per-profile path template override e.g. '{platform}/{channel}/{title}.{ext}'
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue