diff --git a/src/collection.rs b/src/collection.rs index caedf71..f25c10a 100644 --- a/src/collection.rs +++ b/src/collection.rs @@ -14,7 +14,6 @@ pub struct Collection { pub release_date : String , // TODO: Switch to chrono types, I think rusqlite has crate option for it pub runtime_minutes : u32 , pub poster_file_path : Option , - pub video_file_path : Option , } # [ derive (Clone) ] pub struct Series { diff --git a/src/persistence.rs b/src/persistence.rs index 442b236..f8e46a8 100644 --- a/src/persistence.rs +++ b/src/persistence.rs @@ -21,12 +21,19 @@ pub async fn get_collection_from_file () -> Result { let collection = sqlite_client . conn ( |sqlite_connection| { let films = sqlite_connection - . prepare ("select * from films order by release_date desc") ? + . prepare ( " + select uuid , name , original_name , release_date , runtime_minutes , poster_file_path + from films + order by release_date desc + " ) ? . query (()) ? . map (row_to_film) . collect () ? ; let series = sqlite_connection - . prepare ("select * from series") ? + . prepare ( " + select uuid , name , original_name , poster_file_path + from series + " ) ? . query (()) ? . map (row_to_series) . collect () ? ; @@ -44,8 +51,6 @@ fn row_to_film ( row : & Row ) -> rusqlite :: Result { let runtime_minutes = row . get (4) ? ; let poster_file_path = row . get :: < _ , Option > (5) ? . map ( PathBuf :: from ) ; - let video_file_path = row . get :: < _ , Option > (6) ? - . map ( PathBuf :: from ) ; Ok ( Film { uuid , @@ -54,7 +59,6 @@ fn row_to_film ( row : & Row ) -> rusqlite :: Result { release_date , runtime_minutes , poster_file_path , - video_file_path , } ) }