-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added getArtistInfo2 * Added getArtistInfo * Added getAlbumInfo,getAlbumInfo2 * Added setRating * Added getAlbumList,getAlbumList2 * Added license header
- Loading branch information
Showing
40 changed files
with
1,143 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/net/beardbot/subsonic/client/api/browsing/ArtistInfoParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2020 Joscha Düringer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package net.beardbot.subsonic.client.api.browsing; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import net.beardbot.subsonic.client.base.ApiParams; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
class ArtistInfoParams extends ApiParams { | ||
public static ArtistInfoParams create(){ | ||
return new ArtistInfoParams(); | ||
} | ||
|
||
public ArtistInfoParams count(int count) { | ||
setParam("count", String.valueOf(count)); | ||
return this; | ||
} | ||
|
||
public ArtistInfoParams includeNotPresent(boolean includeNotPresent) { | ||
setParam("includeNotPresent", String.valueOf(includeNotPresent)); | ||
return this; | ||
} | ||
|
||
@Override | ||
protected Map<String, List<String>> defaultParams() { | ||
return Map.of("count", List.of("20"), | ||
"includeNotPresent", List.of("false")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/net/beardbot/subsonic/client/api/lists/AlbumListParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright (C) 2020 Joscha Düringer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package net.beardbot.subsonic.client.api.lists; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import net.beardbot.subsonic.client.base.ApiParams; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
class AlbumListParams extends ApiParams { | ||
public static AlbumListParams create(){ | ||
return new AlbumListParams(); | ||
} | ||
|
||
public AlbumListParams type(AlbumListType type) { | ||
setParam("type", type.getValue()); | ||
return this; | ||
} | ||
|
||
public AlbumListParams size(int size) { | ||
setParam("size", String.valueOf(size)); | ||
return this; | ||
} | ||
|
||
public AlbumListParams offset(int offset) { | ||
setParam("offset", String.valueOf(offset)); | ||
return this; | ||
} | ||
|
||
public AlbumListParams fromYear(int fromYear) { | ||
setParam("fromYear", String.valueOf(fromYear)); | ||
return this; | ||
} | ||
|
||
public AlbumListParams toYear(int toYear) { | ||
setParam("toYear", String.valueOf(toYear)); | ||
return this; | ||
} | ||
|
||
public AlbumListParams genre(String genre) { | ||
setParam("genre", genre); | ||
return this; | ||
} | ||
|
||
public AlbumListParams musicFolderId(int musicFolderId) { | ||
setParam("musicFolderId", String.valueOf(musicFolderId)); | ||
return this; | ||
} | ||
|
||
@Override | ||
protected Map<String, List<String>> defaultParams() { | ||
return Map.of( | ||
"type", List.of(AlbumListType.RANDOM.getValue()), | ||
"size", List.of("10"), | ||
"offset", List.of("0")); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/net/beardbot/subsonic/client/api/lists/AlbumListType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (C) 2020 Joscha Düringer | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package net.beardbot.subsonic.client.api.lists; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum AlbumListType { | ||
RANDOM("random"), | ||
NEWEST("newest"), | ||
HIGHEST("highest"), | ||
FREQUENT("frequent"), | ||
RECENT("recent"), | ||
ALPHABETICAL_BY_NAME("alphabeticalByName"), | ||
ALPHABETICAL_BY_ARTIST("alphabeticalByArtist"), | ||
STARRED("starred"), | ||
BY_YEAR("byYear"), | ||
BY_GENRE("byGenre"); | ||
private final String value; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.