diff --git a/pom.xml b/pom.xml index e14ea24..029fb64 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - + org.openjfx javafx-controls @@ -37,14 +37,14 @@ ${javafx.version} - + org.yaml snakeyaml 2.2 - + xerces xercesImpl @@ -54,14 +54,14 @@ - + org.apache.maven.plugins maven-compiler-plugin 3.11.0 - + org.apache.maven.plugins maven-jar-plugin @@ -75,7 +75,7 @@ - + org.apache.maven.plugins maven-shade-plugin diff --git a/src/main/java/com/minster586/radiodjtuna/ConfigManager.java b/src/main/java/com/minster586/radiodjtuna/ConfigManager.java index 499bd92..9c1217f 100644 --- a/src/main/java/com/minster586/radiodjtuna/ConfigManager.java +++ b/src/main/java/com/minster586/radiodjtuna/ConfigManager.java @@ -32,11 +32,11 @@ public class ConfigManager { Yaml yaml = new Yaml(new Constructor(Config.class, new LoaderOptions())); return yaml.load(in); } catch (Exception e) { - System.err.println("❌ Failed to load config.yml: " + e.getMessage()); + System.err.println(" Failed to load config.yml: " + e.getMessage()); } } - System.out.println("📝 Creating new config.yml..."); + System.out.println(" Creating new config.yml..."); Config config = promptUserConfig(); saveConfig(config); convertFallbackToPngIfNecessary(config); @@ -46,13 +46,13 @@ public class ConfigManager { private Config promptUserConfig() { Scanner scanner = new Scanner(System.in); - System.out.print("🔗 Enter RadioDJ API URL (e.g., http://localhost:1234/playing): "); + System.out.print(" Enter RadioDJ API URL (e.g., http://localhost:1234/playing): "); String apiUrl = scanner.nextLine().trim(); - System.out.print("🖼️ Enter path to album art folder: "); + System.out.print(" Enter path to album art folder: "); String artDir = scanner.nextLine().trim(); - System.out.print("🧩 Enter filename of fallback album art (e.g., fallback.jpg): "); + System.out.print(" Enter filename of fallback album art (e.g., fallback.jpg): "); String fallback = scanner.nextLine().trim(); int interval = promptForInterval(scanner); @@ -62,16 +62,16 @@ public class ConfigManager { private int promptForInterval(Scanner scanner) { while (true) { - System.out.print("⏱️ Enter metadata update interval (seconds): "); + System.out.print(" Enter metadata update interval (seconds): "); String input = scanner.nextLine().trim(); if (!input.isEmpty()) { try { return Integer.parseInt(input); } catch (NumberFormatException e) { - System.out.println("⚠️ Please enter a valid number."); + System.out.println(" Please enter a valid number."); } } else { - System.out.println("⚠️ This field is required."); + System.out.println(" This field is required."); } } } @@ -87,9 +87,9 @@ public class ConfigManager { Yaml yaml = new Yaml(representer, options); yaml.dump(config, writer); - System.out.println("✅ Config saved: " + configPath.getFileName()); + System.out.println(" Config saved: " + configPath.getFileName()); } catch (IOException e) { - System.err.println("❌ Failed to save config.yml: " + e.getMessage()); + System.err.println(" Failed to save config.yml: " + e.getMessage()); } } @@ -103,12 +103,12 @@ public class ConfigManager { BufferedImage image = ImageIO.read(jpgFile); if (image != null) { ImageIO.write(image, "png", pngFile); - System.out.println("🎨 Converted fallback image to PNG: " + pngFile.getName()); + System.out.println(" Converted fallback image to PNG: " + pngFile.getName()); config.setFallbackArtFilename(pngFile.getName()); saveConfig(config); // Resave with updated filename } } catch (IOException e) { - System.err.println("❌ Failed to convert fallback image: " + e.getMessage()); + System.err.println(" Failed to convert fallback image: " + e.getMessage()); } } } diff --git a/src/main/java/com/minster586/radiodjtuna/MainApp.java b/src/main/java/com/minster586/radiodjtuna/MainApp.java index c83d4c6..902b354 100644 --- a/src/main/java/com/minster586/radiodjtuna/MainApp.java +++ b/src/main/java/com/minster586/radiodjtuna/MainApp.java @@ -14,7 +14,7 @@ public class MainApp { private static Path cacheFile; public static void main(String[] args) { - System.out.println("🔊 RadioDJ Tuna Bridge starting up..."); + System.out.println(" RadioDJ Tuna Bridge starting up..."); initializePaths(); ensureOutputFolder(); @@ -37,40 +37,40 @@ public class MainApp { try { TrackInfo current = apiClient.fetchNowPlaying(); if (current == null || current.getTitle().isBlank()) { - System.out.println("⚠️ No track data received."); + System.out.println(" No track data received."); return; } if (lastPlayed[0] == null || !current.equals(lastPlayed[0])) { - System.out.println("🎶 New track detected: " + current.getTitle()); + System.out.println(" New track detected: " + current.getTitle()); outputManager.writeOutputFiles(current); cacheManager.saveCache(current); lastPlayed[0] = current; } else { -// System.out.println("⏳ No change — current track: " + current.getTitle()); +// System.out.println(" No change — current track: " + current.getTitle()); } } catch (Exception e) { - System.err.println("🚫 Failed to fetch or process now playing data: " + e.getMessage()); + System.err.println(" Failed to fetch or process now playing data: " + e.getMessage()); } }; int interval = Math.max(config.getUpdateIntervalSeconds(), 3); scheduler.scheduleAtFixedRate(pollingTask, 0, interval, TimeUnit.SECONDS); - System.out.println("⌨️ Press 0 + Enter to stop the app..."); + System.out.println(" Press 0 + Enter to stop the app..."); try (Scanner scanner = new Scanner(System.in)) { while (true) { String input = scanner.nextLine().trim(); if ("0".equals(input)) { - System.out.println("🛑 Shutdown requested. Closing..."); + System.out.println(" Shutdown requested. Closing..."); scheduler.shutdownNow(); break; } } } catch (Exception e) { - System.err.println("❌ Error reading input: " + e.getMessage()); + System.err.println(" Error reading input: " + e.getMessage()); } System.exit(0); @@ -88,9 +88,9 @@ public class MainApp { if (!outFolder.exists()) { boolean created = outFolder.mkdirs(); if (created) { - System.out.println("📁 Created output folder: " + outputDir); + System.out.println(" Created output folder: " + outputDir); } else { - System.err.println("❌ Failed to create output folder. Check permissions."); + System.err.println(" Failed to create output folder. Check permissions."); } } } diff --git a/src/main/java/com/minster586/radiodjtuna/MetadataCacheManager.java b/src/main/java/com/minster586/radiodjtuna/MetadataCacheManager.java index 3379003..93f1a92 100644 --- a/src/main/java/com/minster586/radiodjtuna/MetadataCacheManager.java +++ b/src/main/java/com/minster586/radiodjtuna/MetadataCacheManager.java @@ -39,7 +39,7 @@ public class MetadataCacheManager { return new TrackInfo(title, artist, album, albumArt); } catch (Exception e) { - System.err.println("⚠️ Failed to load last-played.xml: " + e.getMessage()); + System.err.println(" Failed to load last-played.xml: " + e.getMessage()); return null; } } @@ -65,7 +65,7 @@ public class MetadataCacheManager { transformer.transform(input, output); } catch (Exception e) { - System.err.println("❌ Failed to save last-played.xml: " + e.getMessage()); + System.err.println(" Failed to save last-played.xml: " + e.getMessage()); } } diff --git a/src/main/java/com/minster586/radiodjtuna/OutputManager.java b/src/main/java/com/minster586/radiodjtuna/OutputManager.java index d6536c9..967371c 100644 --- a/src/main/java/com/minster586/radiodjtuna/OutputManager.java +++ b/src/main/java/com/minster586/radiodjtuna/OutputManager.java @@ -25,13 +25,13 @@ public class OutputManager { writeTextFile("track-artist.txt", track.getArtist()); writeTextFile("track-album.txt", track.getAlbum()); } catch (IOException e) { - System.err.println("❌ Failed writing metadata text files: " + e.getMessage()); + System.err.println(" Failed writing metadata text files: " + e.getMessage()); } try { convertAlbumArtToPng(track.getAlbumArt()); } catch (Exception e) { - System.err.println("❌ Failed converting album art: " + e.getMessage()); + System.err.println(" Failed converting album art: " + e.getMessage()); } } @@ -39,21 +39,21 @@ public class OutputManager { Path file = outputDir.resolve(fileName); Files.writeString(file, content != null ? content : "", StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); - System.out.println("📄 Wrote file: " + file.getFileName()); + System.out.println(" Wrote file: " + file.getFileName()); } private void convertAlbumArtToPng(String albumArtFileName) { Path destination = outputDir.resolve("album-art.png"); if (albumArtFileName == null || albumArtFileName.isBlank()) { - System.out.println("ℹ️ No album art in tag, using fallback."); + System.out.println(" No album art in tag, using fallback."); convertFallbackToPng(destination); return; } Path sourceFile = albumArtSourceFolder.resolve(albumArtFileName); if (!Files.exists(sourceFile)) { - System.out.println("⚠️ Album art not found: " + sourceFile.getFileName() + ", using fallback."); + System.out.println(" Album art not found: " + sourceFile.getFileName() + ", using fallback."); convertFallbackToPng(destination); return; } @@ -62,13 +62,13 @@ public class OutputManager { BufferedImage image = ImageIO.read(sourceFile.toFile()); if (image != null) { ImageIO.write(image, "png", destination.toFile()); - System.out.println("🎨 Album art converted to PNG: " + destination.getFileName()); + System.out.println(" Album art converted to PNG: " + destination.getFileName()); } else { - System.out.println("⚠️ Could not read album art image, using fallback."); + System.out.println(" Could not read album art image, using fallback."); convertFallbackToPng(destination); } } catch (IOException e) { - System.err.println("❌ Failed converting album art: " + e.getMessage()); + System.err.println(" Failed converting album art: " + e.getMessage()); convertFallbackToPng(destination); } } @@ -76,7 +76,7 @@ public class OutputManager { private void convertFallbackToPng(Path destination) { Path fallbackSource = outputDir.resolve(fallbackArtFilename); if (!Files.exists(fallbackSource)) { - System.err.println("❌ Fallback art file is missing: " + fallbackSource); + System.err.println(" Fallback art file is missing: " + fallbackSource); return; } @@ -84,12 +84,12 @@ public class OutputManager { BufferedImage image = ImageIO.read(fallbackSource.toFile()); if (image != null) { ImageIO.write(image, "png", destination.toFile()); - System.out.println("🖼️ Fallback album art converted to PNG."); + System.out.println(" Fallback album art converted to PNG."); } else { - System.err.println("❌ Could not read fallback image."); + System.err.println(" Could not read fallback image."); } } catch (IOException e) { - System.err.println("❌ Failed to convert fallback art: " + e.getMessage()); + System.err.println(" Failed to convert fallback art: " + e.getMessage()); } } } \ No newline at end of file