From 76921f685562a5a32c15f1eceb3cf7d2dc2c989f Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Tue, 19 Apr 2022 23:42:48 +0100 Subject: [PATCH] Song: add isDownloaded() method. --- src/main/java/moe/nekojimi/chords/Song.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/moe/nekojimi/chords/Song.java b/src/main/java/moe/nekojimi/chords/Song.java index 0eb2299..30ffb2c 100644 --- a/src/main/java/moe/nekojimi/chords/Song.java +++ b/src/main/java/moe/nekojimi/chords/Song.java @@ -75,6 +75,11 @@ public class Song return song; } + public boolean isDownloaded() + { + return (location != null && location.exists() && location.canRead()); + } + public String getTitle() { return title; @@ -191,5 +196,4 @@ public class Song return formats.get(0); } - }