From cf24072f355389adee7f8aff0b7399ed650e4f07 Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Thu, 30 Sep 2021 20:48:29 +0100 Subject: [PATCH] Song: add sequence number. --- src/main/java/moe/nekojimi/chords/Song.java | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/java/moe/nekojimi/chords/Song.java b/src/main/java/moe/nekojimi/chords/Song.java index 2251b68..72ba243 100644 --- a/src/main/java/moe/nekojimi/chords/Song.java +++ b/src/main/java/moe/nekojimi/chords/Song.java @@ -6,7 +6,6 @@ package moe.nekojimi.chords; import java.io.File; -import java.net.MalformedURLException; import java.net.URL; /** @@ -19,17 +18,14 @@ public class Song private String artist; private final URL url; private File location = null; + private int number; private String requestedBy; private String requestedIn; - public Song(URL url) throws MalformedURLException + public Song(URL url) { - if (url.toString().equalsIgnoreCase("https://soundcloud.com/user-185855194/fart-with-extra-reverb") - || url.toString().equalsIgnoreCase("https://www.youtube.com/watch?v=hr7GyFM7pX4")) - this.url = new URL("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); - else - this.url = url; + this.url = url; } public String getTitle() @@ -42,6 +38,16 @@ public class Song this.title = title; } + public int getNumber() + { + return number; + } + + public void setNumber(int number) + { + this.number = number; + } + public String getArtist() { return artist; @@ -100,6 +106,7 @@ public class Song if (title != null && !title.isEmpty()) return title; else - return url.toExternalForm(); + return "track " + number; +// return url.toExternalForm(); } }