Address code review feedback - fix imports and error handling

Co-authored-by: leinelissen <10154841+leinelissen@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-08 20:45:17 +00:00
co-authored by leinelissen
parent 7c10aceb44
commit a087469725
21 changed files with 30 additions and 21 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Albums table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Artists table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index, primaryKey } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Album-Artists relation table (many-to-many)
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, primaryKey } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Album-Similar relation table (for similar albums)
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Albums table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Artists table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Downloads table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index, primaryKey } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Playlist-Tracks relation table (many-to-many with position)
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Playlists table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Search queries table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, primaryKey } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Sync cursors table - tracks prefill progress
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index, primaryKey } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Track-Artists relation table (many-to-many)
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Tracks table
+2 -2
View File
@@ -33,7 +33,7 @@ export async function initializeDownload(
hash: hash || null,
filename: filename || null,
mimetype: mimetype || null,
progress: 0,
progress: null,
isFailed: false,
isComplete: false,
metadataJson: null,
@@ -45,7 +45,7 @@ export async function initializeDownload(
hash: hash || null,
filename: filename || null,
mimetype: mimetype || null,
progress: 0,
progress: null,
isFailed: false,
isComplete: false,
updatedAt: now,
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Downloads table
+7 -1
View File
@@ -45,7 +45,13 @@ export async function downloadTrack(trackId: string): Promise<void> {
}
// Parse metadata if needed for image URL
const metadata = track.metadataJson ? JSON.parse(track.metadataJson as string) : {};
let metadata: any = {};
try {
metadata = track.metadataJson ? JSON.parse(track.metadataJson as string) : {};
} catch (error) {
console.warn('Failed to parse track metadata:', error);
}
const trackWithMetadata = { ...track, ...metadata };
const audioUrl = generateTrackUrl(trackId);
+3
View File
@@ -17,6 +17,9 @@ const persistConfig: PersistConfig<Omit<AppState, '_persist'>> = {
migrate: createMigrate({
// @ts-expect-error migrations are poorly typed
6: (state: AppState & PersistState) => {
// Migration v6: Remove music and downloads from Redux
// These are now database-backed only. Intentionally discarding
// old Redux state as data is persisted in SQLite database.
return {
settings: state.settings,
sleepTimer: state.sleepTimer,
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Playlists table
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Search queries table
+1 -1
View File
@@ -4,7 +4,7 @@ import { sqliteTable, integer } from 'drizzle-orm/sqlite-core';
* Sleep timer - global sleep timer settings (single row, id=1)
*/
export const sleepTimer = sqliteTable('sleep_timer', {
id: integer('id').primaryKey().$default(() => 1),
id: integer('id').primaryKey(),
date: integer('date'), // nullable - epoch ms
createdAt: integer('created_at').notNull(),
updatedAt: integer('updated_at').notNull(),
+1 -1
View File
@@ -1,5 +1,5 @@
import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core';
import { sources } from './sources';
import { sources } from '../db/schema/sources';
/**
* Tracks table