Compare commits
	
		
			2 Commits
		
	
	
		
			1.1.0
			...
			189645254b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					189645254b | ||
| 
						 | 
					a46d810d0a | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -182,3 +182,4 @@ cython_debug/
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# ed1337x
 | 
					# ed1337x
 | 
				
			||||||
config.ini
 | 
					config.ini
 | 
				
			||||||
 | 
					Run.ps1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@ def analyze_bpm_librosa(file_path):
 | 
				
			|||||||
    try:
 | 
					    try:
 | 
				
			||||||
        y, sr = librosa.load(file_path, mono=True)
 | 
					        y, sr = librosa.load(file_path, mono=True)
 | 
				
			||||||
        tempo, _ = librosa.beat.beat_track(y=y, sr=sr)
 | 
					        tempo, _ = librosa.beat.beat_track(y=y, sr=sr)
 | 
				
			||||||
        return int(round(float(tempo[0])))
 | 
					        return int(round(float(tempo)))
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print(f"Error analyzing BPM for {file_path.name}: {e}")
 | 
					        print(f"Error analyzing BPM for {file_path.name}: {e}")
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
@@ -87,11 +87,6 @@ def main():
 | 
				
			|||||||
        print(f"Error: {source_media_path} is not a valid directory.")
 | 
					        print(f"Error: {source_media_path} is not a valid directory.")
 | 
				
			||||||
        sys.exit(1)
 | 
					        sys.exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    parent = source_media_path.parent
 | 
					 | 
				
			||||||
    folder_name = source_media_path.name
 | 
					 | 
				
			||||||
    dest_media_path = parent / f"[CDs-{run_date}]{folder_name}"
 | 
					 | 
				
			||||||
    dest_media_path.mkdir(parents=True, exist_ok=True)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    all_tracks = []
 | 
					    all_tracks = []
 | 
				
			||||||
    for file in source_media_path.rglob("*.mp3"):
 | 
					    for file in source_media_path.rglob("*.mp3"):
 | 
				
			||||||
        bpm = get_bpm(file)
 | 
					        bpm = get_bpm(file)
 | 
				
			||||||
@@ -118,6 +113,11 @@ def main():
 | 
				
			|||||||
        print("No MP3 files found.")
 | 
					        print("No MP3 files found.")
 | 
				
			||||||
        sys.exit(0)
 | 
					        sys.exit(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    parent = source_media_path.parent
 | 
				
			||||||
 | 
					    folder_name = source_media_path.name
 | 
				
			||||||
 | 
					    dest_media_path = parent / f"[CDs-{run_date}]{folder_name}"
 | 
				
			||||||
 | 
					    dest_media_path.mkdir(parents=True, exist_ok=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    total_size = sum(t["size"] for t in all_tracks)
 | 
					    total_size = sum(t["size"] for t in all_tracks)
 | 
				
			||||||
    num_cds = max(1, (total_size + CD_SIZE - 1) // CD_SIZE)
 | 
					    num_cds = max(1, (total_size + CD_SIZE - 1) // CD_SIZE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										25
									
								
								Run.cmd
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								Run.cmd
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					@echo off
 | 
				
			||||||
 | 
					setlocal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REM Define paths
 | 
				
			||||||
 | 
					set VENV_DIR=venv
 | 
				
			||||||
 | 
					set APP_DIR=Program
 | 
				
			||||||
 | 
					set PYTHON=%VENV_DIR%\Scripts\python.exe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REM Check for venv
 | 
				
			||||||
 | 
					if not exist %VENV_DIR% (
 | 
				
			||||||
 | 
					    echo Creating virtual environment...
 | 
				
			||||||
 | 
					    python -m venv %VENV_DIR%
 | 
				
			||||||
 | 
					    echo Installing dependencies...
 | 
				
			||||||
 | 
					    %PYTHON% -m pip install --upgrade pip
 | 
				
			||||||
 | 
					    %PYTHON% -m pip install -r requirements.txt
 | 
				
			||||||
 | 
					) else (
 | 
				
			||||||
 | 
					    echo Virtual environment found, assuming dependencies are satisfied.
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REM Run the app
 | 
				
			||||||
 | 
					cd /d %~dp0%APP_DIR%
 | 
				
			||||||
 | 
					..\%VENV_DIR%\Scripts\python.exe app.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					endlocal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1,13 +0,0 @@
 | 
				
			|||||||
@echo off
 | 
					 | 
				
			||||||
REM Create Python virtual environment named "venv"
 | 
					 | 
				
			||||||
python -m venv venv
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
REM Activate the virtual environment
 | 
					 | 
				
			||||||
call venv\Scripts\activate.bat
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
REM Upgrade pip
 | 
					 | 
				
			||||||
python -m pip install --upgrade pip
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
REM Install dependencies
 | 
					 | 
				
			||||||
pip install mutagen
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,12 +0,0 @@
 | 
				
			|||||||
# Create Python virtual environment named "venv"
 | 
					 | 
				
			||||||
python -m venv venv
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Activate the virtual environment
 | 
					 | 
				
			||||||
& .\venv\Scripts\Activate.ps1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Upgrade pip
 | 
					 | 
				
			||||||
python -m pip install --upgrade pip
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Install dependencies
 | 
					 | 
				
			||||||
pip install mutagen
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user