feat: recursively scan through directory, refactor library and import functions, add more basic information to schema

This commit is contained in:
skybldev
2026-10-24 00:59:34 -04:00
parent f62a99feb6
commit c5c3f1ebc0
10 changed files with 408 additions and 153 deletions

View File

@@ -16,6 +16,7 @@ pub struct Artist {
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
pub struct Collection {
pub id: i32,
pub artist_id: Option<i32>,
pub collection_type: String,
pub original_name: String,
pub display_name: String,
@@ -28,7 +29,8 @@ pub struct Collection {
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
pub struct Track {
pub id: i32,
pub artist_id: i32,
pub file_path: String,
pub artist_id: Option<i32>,
pub collection_id: Option<i32>,
pub original_title: Option<String>,
pub display_title: Option<String>,
@@ -48,6 +50,7 @@ pub struct NewArtist<'a> {
#[derive(Debug, Clone, Insertable)]
#[diesel(table_name = collections)]
pub struct NewCollection<'a> {
pub artist_id: Option<i32>,
pub collection_type: &'a str,
pub original_name: &'a str,
pub display_name: &'a str,
@@ -56,7 +59,8 @@ pub struct NewCollection<'a> {
#[derive(Debug, Clone, Insertable)]
#[diesel(table_name = tracks)]
pub struct NewTrack<'a> {
pub artist_id: i32,
pub file_path: &'a str,
pub artist_id: Option<i32>,
pub collection_id: Option<i32>,
pub original_title: Option<&'a str>,
pub display_title: Option<&'a str>,