diff --git a/migrations/000020_alter_files_table_transcode.down.sql b/migrations/000020_alter_files_table_transcode.down.sql index 1f13efa..dd856a5 100644 --- a/migrations/000020_alter_files_table_transcode.down.sql +++ b/migrations/000020_alter_files_table_transcode.down.sql @@ -1,4 +1,4 @@ -ALTER TABLE tasks +ALTER TABLE files DROP IF EXISTS old_md5, DROP IF EXISTS old_ffprobe_data, -DROP IF EXISTS old_size bigint; +DROP IF EXISTS old_size; diff --git a/migrations/000020_alter_files_table_transcode.up.sql b/migrations/000020_alter_files_table_transcode.up.sql index 1bcebe0..bca1ce6 100644 --- a/migrations/000020_alter_files_table_transcode.up.sql +++ b/migrations/000020_alter_files_table_transcode.up.sql @@ -1,4 +1,3 @@ -ALTER TABLE libraries -ADD old_md5 uuid, +ALTER TABLE files ADD old_md5 uuid, ADD old_ffprobe_data JSONB, ADD old_size bigint; diff --git a/server/library.go b/server/library.go index e9031be..d4fa229 100644 --- a/server/library.go +++ b/server/library.go @@ -65,7 +65,7 @@ func handleLibrary(w http.ResponseWriter, r *http.Request) { Enable: enabled, } - rows, err := db.Query(r.Context(), "SELECT id, path, size, status, health, transcode, md5, updated_at FROM files where library_id = $1", id) + rows, err := db.Query(r.Context(), "SELECT id, path, size, old_size, status, health, transcode, md5, old_md5, updated_at FROM files where library_id = $1", id) if err != nil { slog.ErrorContext(r.Context(), "Query Files", "err", err) http.Error(w, "Error Query Files: "+err.Error(), http.StatusInternalServerError)