From a2ba99d60020982e877420f608c096641072bce0 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Thu, 2 Mar 2023 09:03:46 -0500 Subject: [PATCH] Rename files --- music-player/client/src/{blocks => components}/track.ts | 0 music-player/client/src/main.ts | 9 +-------- music-player/server/src/bin/server.rs | 4 ++-- music-player/server/src/core.rs | 6 ++---- music-player/server/src/database.rs | 2 +- music-player/server/src/lib.rs | 4 ++-- music-player/server/src/{audio.rs => media.rs} | 0 music-player/server/src/{music_scanner.rs => scanner.rs} | 4 ++-- 8 files changed, 10 insertions(+), 19 deletions(-) rename music-player/client/src/{blocks => components}/track.ts (100%) rename music-player/server/src/{audio.rs => media.rs} (100%) rename music-player/server/src/{music_scanner.rs => scanner.rs} (99%) diff --git a/music-player/client/src/blocks/track.ts b/music-player/client/src/components/track.ts similarity index 100% rename from music-player/client/src/blocks/track.ts rename to music-player/client/src/components/track.ts diff --git a/music-player/client/src/main.ts b/music-player/client/src/main.ts index b85ab4f..657a044 100644 --- a/music-player/client/src/main.ts +++ b/music-player/client/src/main.ts @@ -1,6 +1,6 @@ import * as _ from "lodash"; import { TrackInfo, getTracks } from "./client"; -import { TrackName, TrackCard } from "./blocks/track"; +import { TrackName, TrackCard } from "./components/track"; window.customElements.define("track-name", TrackName); window.customElements.define("track-card", TrackCard); @@ -12,13 +12,6 @@ declare global { } } -const replaceTitle = () => { - const title = document.querySelector(".js-title"); - if (title && title.innerHTML) { - title.innerHTML = "Music Player Paused"; - } -}; - const updateTrackList = (tracks: TrackInfo[]) => { const track_list = document.querySelector(".track-list__tracks"); if (track_list) { diff --git a/music-player/server/src/bin/server.rs b/music-player/server/src/bin/server.rs index 2532edb..ae1d08c 100644 --- a/music-player/server/src/bin/server.rs +++ b/music-player/server/src/bin/server.rs @@ -7,10 +7,10 @@ use std::{ use warp::Filter; use music_player::{ - audio::TrackInfo, core::Core, database::{MemoryIndex, MusicIndex}, - music_scanner::FileScanner, + media::TrackInfo, + scanner::FileScanner, }; fn tracks(index: &Arc) -> Vec { diff --git a/music-player/server/src/core.rs b/music-player/server/src/core.rs index 5126a2a..290ccce 100644 --- a/music-player/server/src/core.rs +++ b/music-player/server/src/core.rs @@ -1,6 +1,4 @@ -use crate::{ - audio::TrackInfo, database::MusicIndex, music_scanner::MusicScanner, Error, FatalError, -}; +use crate::{database::MusicIndex, media::TrackInfo, scanner::MusicScanner, Error, FatalError}; use flow::{ok, Flow}; use std::{ sync::{ @@ -108,7 +106,7 @@ impl Core { #[cfg(test)] mod test { use super::*; - use crate::{audio::TrackId, database::MemoryIndex, music_scanner::factories::MockScanner}; + use crate::{database::MemoryIndex, media::TrackId, scanner::factories::MockScanner}; use std::collections::HashSet; fn with_example_index(f: F) diff --git a/music-player/server/src/database.rs b/music-player/server/src/database.rs index 8bad082..4407c9d 100644 --- a/music-player/server/src/database.rs +++ b/music-player/server/src/database.rs @@ -1,5 +1,5 @@ use crate::{ - audio::{TrackId, TrackInfo}, + media::{TrackId, TrackInfo}, FatalError, }; use flow::{error, ok, Flow}; diff --git a/music-player/server/src/lib.rs b/music-player/server/src/lib.rs index cbf09e5..66dfc1d 100644 --- a/music-player/server/src/lib.rs +++ b/music-player/server/src/lib.rs @@ -1,7 +1,7 @@ -pub mod audio; pub mod core; pub mod database; -pub mod music_scanner; +pub mod media; +pub mod scanner; use database::DatabaseError; use thiserror::Error; diff --git a/music-player/server/src/audio.rs b/music-player/server/src/media.rs similarity index 100% rename from music-player/server/src/audio.rs rename to music-player/server/src/media.rs diff --git a/music-player/server/src/music_scanner.rs b/music-player/server/src/scanner.rs similarity index 99% rename from music-player/server/src/music_scanner.rs rename to music-player/server/src/scanner.rs index 07b6aad..4634d3e 100644 --- a/music-player/server/src/music_scanner.rs +++ b/music-player/server/src/scanner.rs @@ -1,4 +1,4 @@ -use crate::audio::{TrackId, TrackInfo}; +use crate::media::{TrackId, TrackInfo}; use id3::{Tag, TagLike}; use std::{ fs::{DirEntry, ReadDir}, @@ -187,7 +187,7 @@ impl MusicScanner for FileScanner { #[cfg(test)] pub mod factories { use super::*; - use crate::audio::TrackId; + use crate::media::TrackId; pub struct MockScanner { data: Vec,