mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Multi server/user implementation
This commit is contained in:
parent
4e269a7446
commit
78a4006ed6
30 changed files with 959 additions and 192 deletions
|
|
@ -34,7 +34,7 @@ public class Album implements Parcelable {
|
|||
public Album(AlbumID3 albumID3) {
|
||||
this.id = albumID3.getId();
|
||||
this.title = albumID3.getName();
|
||||
this.year = albumID3.getYear();
|
||||
this.year = albumID3.getYear() != null ? albumID3.getYear() : 0;
|
||||
this.artistId = albumID3.getArtistId();
|
||||
this.artistName = albumID3.getArtist();
|
||||
this.primary = albumID3.getCoverArtId();
|
||||
|
|
@ -44,7 +44,7 @@ public class Album implements Parcelable {
|
|||
public Album(AlbumWithSongsID3 albumWithSongsID3) {
|
||||
this.id = albumWithSongsID3.getId();
|
||||
this.title = albumWithSongsID3.getName();
|
||||
this.year = albumWithSongsID3.getYear();
|
||||
this.year = albumWithSongsID3.getYear() != null ? albumWithSongsID3.getYear() : 0;
|
||||
this.artistId = albumWithSongsID3.getArtistId();
|
||||
this.artistName = albumWithSongsID3.getArtist();
|
||||
this.primary = albumWithSongsID3.getCoverArtId();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,10 @@ public class Download {
|
|||
@ColumnInfo(name = "duration")
|
||||
private long duration;
|
||||
|
||||
public Download(String songID, String title, String albumId, String albumName, String artistId, String artistName, String primary, long duration) {
|
||||
@ColumnInfo(name = "server")
|
||||
private String server;
|
||||
|
||||
public Download(String songID, String title, String albumId, String albumName, String artistId, String artistName, String primary, long duration, String server) {
|
||||
this.songID = songID;
|
||||
this.title = title;
|
||||
this.albumId = albumId;
|
||||
|
|
@ -42,6 +45,7 @@ public class Download {
|
|||
this.artistName = artistName;
|
||||
this.primary = primary;
|
||||
this.duration = duration;
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
public Download(Song song) {
|
||||
|
|
@ -118,4 +122,12 @@ public class Download {
|
|||
public void setDuration(long duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getServer() {
|
||||
return server;
|
||||
}
|
||||
|
||||
public void setServer(String server) {
|
||||
this.server = server;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ public class Queue {
|
|||
@ColumnInfo(name = "duration")
|
||||
private long duration;
|
||||
|
||||
public Queue(int trackOrder, String songID, String title, String albumId, String albumName, String artistId, String artistName, String primary, long duration) {
|
||||
@ColumnInfo(name = "server")
|
||||
private String server;
|
||||
|
||||
public Queue(int trackOrder, String songID, String title, String albumId, String albumName, String artistId, String artistName, String primary, long duration, String server) {
|
||||
this.trackOrder = trackOrder;
|
||||
this.songID = songID;
|
||||
this.title = title;
|
||||
|
|
@ -46,6 +49,7 @@ public class Queue {
|
|||
this.artistName = artistName;
|
||||
this.primary = primary;
|
||||
this.duration = duration;
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
public int getTrackOrder() {
|
||||
|
|
@ -119,4 +123,12 @@ public class Queue {
|
|||
public void setDuration(long duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getServer() {
|
||||
return server;
|
||||
}
|
||||
|
||||
public void setServer(String server) {
|
||||
this.server = server;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class RecentSearch {
|
|||
@ColumnInfo(name = "search")
|
||||
private String search;
|
||||
|
||||
public RecentSearch(String search) {
|
||||
public RecentSearch(@NonNull String search) {
|
||||
this.search = search;
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ public class RecentSearch {
|
|||
return search;
|
||||
}
|
||||
|
||||
public void setSearch(String search) {
|
||||
public void setSearch(@NonNull String search) {
|
||||
this.search = search;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,99 @@
|
|||
package com.cappielloantonio.play.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "server")
|
||||
public class Server {
|
||||
@NonNull
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
private String serverId;
|
||||
|
||||
@ColumnInfo(name = "server_name")
|
||||
private String serverName;
|
||||
|
||||
@ColumnInfo(name = "username")
|
||||
private String username;
|
||||
|
||||
@ColumnInfo(name = "address")
|
||||
private String address;
|
||||
|
||||
@ColumnInfo(name = "token")
|
||||
private String token;
|
||||
|
||||
@ColumnInfo(name = "salt")
|
||||
private String salt;
|
||||
|
||||
@ColumnInfo(name = "timestamp")
|
||||
private long timestamp;
|
||||
|
||||
public Server(@NonNull String serverId, String serverName, String username, String address, String token, String salt, long timestamp) {
|
||||
this.serverId = serverId;
|
||||
this.serverName = serverName;
|
||||
this.username = username;
|
||||
this.address = address;
|
||||
this.token = token;
|
||||
this.salt = salt;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(@NonNull String serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
public void setServerName(String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(String salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue