chore: Added nullable contentRating columns to channels and content_ite…

- "src/db/schema/channels.ts"
- "src/db/schema/content.ts"
- "src/types/index.ts"
- "src/db/repositories/system-config-repository.ts"
- "src/db/repositories/content-repository.ts"
- "src/__tests__/scheduler.test.ts"
- "drizzle/0017_wild_havok.sql"

GSD-Task: S05/T01
This commit is contained in:
jlightner 2026-04-04 06:08:16 +00:00
parent 01f4a2d38a
commit e0b6424932
9 changed files with 1146 additions and 0 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE `channels` ADD `content_rating` text;--> statement-breakpoint
ALTER TABLE `content_items` ADD `content_rating` text;

File diff suppressed because it is too large Load diff

View file

@ -120,6 +120,13 @@
"when": 1775281783887,
"tag": "0016_right_galactus",
"breakpoints": true
},
{
"idx": 17,
"version": "6",
"when": 1775282773898,
"tag": "0017_wild_havok",
"breakpoints": true
}
]
}

View file

@ -610,6 +610,7 @@ describe('SchedulerService', () => {
qualityMetadata: null,
status: 'monitored',
monitored: false,
contentRating: null,
publishedAt: null,
downloadedAt: null,
createdAt: new Date().toISOString(),

View file

@ -456,6 +456,7 @@ function mapRow(row: typeof contentItems.$inferSelect): ContentItem {
publishedAt: row.publishedAt ?? null,
downloadedAt: row.downloadedAt ?? null,
monitored: row.monitored,
contentRating: row.contentRating ?? null,
createdAt: row.createdAt,
updatedAt: row.updatedAt,
};

View file

@ -11,6 +11,7 @@ type Db = LibSQLDatabase<typeof schema>;
export const APP_CHECK_INTERVAL = 'app.check_interval';
export const APP_CONCURRENT_DOWNLOADS = 'app.concurrent_downloads';
export const APP_OUTPUT_TEMPLATE = 'app.output_template';
export const APP_NFO_ENABLED = 'app.nfo_enabled';
export const YTDLP_LAST_UPDATED = 'ytdlp.last_updated';
// ── Read / Write ──

View file

@ -33,4 +33,5 @@ export const channels = sqliteTable('channels', {
subscriberCount: integer('subscriber_count'),
includeKeywords: text('include_keywords'), // nullable — pipe-separated patterns for auto-enqueue filtering
excludeKeywords: text('exclude_keywords'), // nullable — pipe-separated patterns for auto-enqueue filtering
contentRating: text('content_rating'), // nullable — default rating for all content from this channel (e.g. 'TV-PG', 'TV-MA')
});

View file

@ -21,6 +21,7 @@ export const contentItems = sqliteTable('content_items', {
publishedAt: text('published_at'), // ISO datetime from platform (nullable)
downloadedAt: text('downloaded_at'), // ISO datetime when download completed (nullable)
monitored: integer('monitored', { mode: 'boolean' }).notNull().default(true), // per-item monitoring toggle
contentRating: text('content_rating'), // nullable — per-item rating override (e.g. 'TV-PG', 'TV-MA')
createdAt: text('created_at')
.notNull()
.default(sql`(datetime('now'))`),

View file

@ -102,6 +102,7 @@ export interface ContentItem {
publishedAt: string | null;
downloadedAt: string | null;
monitored: boolean;
contentRating: string | null;
createdAt: string;
updatedAt: string;
}