ultrasonic-app-subsonic-and.../ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/MusicService.kt

191 lines
5.3 KiB
Kotlin
Raw Normal View History

2013-04-06 21:47:24 +02:00
/*
2021-05-26 23:17:52 +02:00
* MusicService.kt
* Copyright (C) 2009-2021 Ultrasonic developers
*
* Distributed under terms of the GNU GPLv3 license.
2013-04-06 21:47:24 +02:00
*/
2021-05-26 23:17:52 +02:00
package org.moire.ultrasonic.service
2021-05-26 23:25:56 +02:00
import java.io.InputStream
import org.moire.ultrasonic.domain.Album
import org.moire.ultrasonic.domain.Artist
2021-05-26 23:17:52 +02:00
import org.moire.ultrasonic.domain.Bookmark
import org.moire.ultrasonic.domain.ChatMessage
import org.moire.ultrasonic.domain.Genre
import org.moire.ultrasonic.domain.Index
2021-05-26 23:17:52 +02:00
import org.moire.ultrasonic.domain.JukeboxStatus
import org.moire.ultrasonic.domain.Lyrics
import org.moire.ultrasonic.domain.MusicDirectory
import org.moire.ultrasonic.domain.MusicFolder
import org.moire.ultrasonic.domain.Playlist
import org.moire.ultrasonic.domain.PodcastsChannel
import org.moire.ultrasonic.domain.SearchCriteria
import org.moire.ultrasonic.domain.SearchResult
import org.moire.ultrasonic.domain.Share
import org.moire.ultrasonic.domain.Track
2021-05-26 23:17:52 +02:00
import org.moire.ultrasonic.domain.UserInfo
2021-05-27 11:18:29 +02:00
@Suppress("TooManyFunctions")
2021-05-26 23:17:52 +02:00
interface MusicService {
@Throws(Exception::class)
fun ping()
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun isLicenseValid(): Boolean
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getGenres(refresh: Boolean): List<Genre>?
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun star(id: String?, albumId: String?, artistId: String?)
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun unstar(id: String?, albumId: String?, artistId: String?)
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun setRating(id: String, rating: Int)
2020-01-13 21:20:52 +01:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getMusicFolders(refresh: Boolean): List<MusicFolder>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getIndexes(musicFolderId: String?, refresh: Boolean): List<Index>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getArtists(refresh: Boolean): List<Artist>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getMusicDirectory(id: String, name: String?, refresh: Boolean): MusicDirectory
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getAlbumsOfArtist(id: String, name: String?, refresh: Boolean): List<Album>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getAlbum(id: String, name: String?, refresh: Boolean): MusicDirectory
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun search(criteria: SearchCriteria): SearchResult?
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getPlaylist(id: String, name: String): MusicDirectory
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getPodcastsChannels(refresh: Boolean): List<PodcastsChannel>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getPlaylists(refresh: Boolean): List<Playlist>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun createPlaylist(id: String?, name: String?, tracks: List<Track>)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun deletePlaylist(id: String)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun updatePlaylist(id: String, name: String?, comment: String?, pub: Boolean)
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getLyrics(artist: String, title: String): Lyrics?
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun scrobble(id: String, submission: Boolean)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getAlbumList(
type: String,
size: Int,
offset: Int,
musicFolderId: String?
): List<Album>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getAlbumList2(
type: String,
size: Int,
offset: Int,
musicFolderId: String?
): List<Album>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getRandomSongs(size: Int): MusicDirectory
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getSongsByGenre(genre: String, count: Int, offset: Int): MusicDirectory
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getStarred(): SearchResult
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getStarred2(): SearchResult
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
/**
* Return response [InputStream] and a [Boolean] that indicates if this response is
* partial.
*/
@Throws(Exception::class)
fun getDownloadInputStream(
song: Track,
2021-05-26 23:17:52 +02:00
offset: Long,
maxBitrate: Int,
save: Boolean
2021-05-26 23:17:52 +02:00
): Pair<InputStream, Boolean>
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
2021-06-11 10:42:40 +02:00
fun getVideoUrl(id: String): String?
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun updateJukeboxPlaylist(ids: List<String>?): JukeboxStatus
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun skipJukebox(index: Int, offsetSeconds: Int): JukeboxStatus
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun stopJukebox(): JukeboxStatus
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun startJukebox(): JukeboxStatus
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getJukeboxStatus(): JukeboxStatus
2013-04-06 21:47:24 +02:00
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun setJukeboxGain(gain: Float): JukeboxStatus
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getShares(refresh: Boolean): List<Share>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getChatMessages(since: Long?): List<ChatMessage?>?
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun addChatMessage(message: String)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getBookmarks(): List<Bookmark>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun deleteBookmark(id: String)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun createBookmark(id: String, position: Int)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getVideos(refresh: Boolean): MusicDirectory?
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getUser(username: String): UserInfo
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun createShare(ids: List<String>, description: String?, expires: Long?): List<Share>
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun deleteShare(id: String)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun updateShare(id: String, description: String?, expires: Long?)
2021-05-26 23:17:52 +02:00
@Throws(Exception::class)
fun getPodcastEpisodes(podcastChannelId: String?): MusicDirectory?
2021-05-26 23:25:56 +02:00
}