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:
parent
01f4a2d38a
commit
e0b6424932
9 changed files with 1146 additions and 0 deletions
2
drizzle/0017_wild_havok.sql
Normal file
2
drizzle/0017_wild_havok.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `channels` ADD `content_rating` text;--> statement-breakpoint
|
||||
ALTER TABLE `content_items` ADD `content_rating` text;
|
||||
1131
drizzle/meta/0017_snapshot.json
Normal file
1131
drizzle/meta/0017_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -120,6 +120,13 @@
|
|||
"when": 1775281783887,
|
||||
"tag": "0016_right_galactus",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 17,
|
||||
"version": "6",
|
||||
"when": 1775282773898,
|
||||
"tag": "0017_wild_havok",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -610,6 +610,7 @@ describe('SchedulerService', () => {
|
|||
qualityMetadata: null,
|
||||
status: 'monitored',
|
||||
monitored: false,
|
||||
contentRating: null,
|
||||
publishedAt: null,
|
||||
downloadedAt: null,
|
||||
createdAt: new Date().toISOString(),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 ──
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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'))`),
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ export interface ContentItem {
|
|||
publishedAt: string | null;
|
||||
downloadedAt: string | null;
|
||||
monitored: boolean;
|
||||
contentRating: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue