diff --git a/src/main/kotlin/net/halfbinary/prettyplayerapi/service/MusicService.kt b/src/main/kotlin/net/halfbinary/prettyplayerapi/service/MusicService.kt index ff8fad3..de868b1 100644 --- a/src/main/kotlin/net/halfbinary/prettyplayerapi/service/MusicService.kt +++ b/src/main/kotlin/net/halfbinary/prettyplayerapi/service/MusicService.kt @@ -9,7 +9,6 @@ class MusicService(private val albumCacheService: AlbumCacheService) { fun getMusic(albumHash: String, trackNumber: Int): File { val albumInfo = albumCacheService.getAlbumCache()[albumHash] return if(albumInfo != null) { - File(albumInfo.albumFolder).listFiles()[trackNumber-1] File(albumInfo.albumFolder).listFiles().sortedBy { it.name }[trackNumber-1] } else { throw AlbumHashNotFoundException("Album hash $albumHash not found")