mirror of
https://gitea.mayex.net/mayekkuzu/Audinaut.git
synced 2025-01-23 12:44:54 +03:00
Remove unreachable
This commit is contained in:
parent
d8ee4d012c
commit
d84327db02
@ -23,7 +23,7 @@ import android.content.Context;
|
||||
public class AudioEffectsController {
|
||||
|
||||
private final Context context;
|
||||
private int audioSessionId = 0;
|
||||
private int audioSessionId;
|
||||
|
||||
private EqualizerController equalizerController;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class EqualizerController {
|
||||
private boolean loudnessAvailable = false;
|
||||
private LoudnessEnhancerController loudnessEnhancerController;
|
||||
private boolean released = false;
|
||||
private int audioSessionId = 0;
|
||||
private int audioSessionId;
|
||||
|
||||
public EqualizerController(Context context, int audioSessionId) {
|
||||
this.context = context;
|
||||
|
@ -39,17 +39,12 @@ public class User implements Serializable {
|
||||
ROLES.add(COMMENT);
|
||||
}
|
||||
|
||||
private final List<Setting> settings = new ArrayList<>();
|
||||
private List<Setting> musicFolders;
|
||||
|
||||
public User() {
|
||||
|
||||
}
|
||||
|
||||
public void addSetting(String name, Boolean value) {
|
||||
settings.add(new Setting(name, value));
|
||||
}
|
||||
|
||||
public void addMusicFolder(MusicFolder musicFolder) {
|
||||
if (musicFolders == null) {
|
||||
musicFolders = new ArrayList<>();
|
||||
@ -66,10 +61,6 @@ public class User implements Serializable {
|
||||
private String name;
|
||||
private Boolean value;
|
||||
|
||||
public Setting() {
|
||||
|
||||
}
|
||||
|
||||
public Setting(String name, Boolean value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
|
@ -176,13 +176,11 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Serializable> i
|
||||
entries = indexes.getEntries();
|
||||
items.addAll(entries);
|
||||
} else {
|
||||
List<Artist> artists = new ArrayList<>();
|
||||
MusicDirectory dir = musicService.getMusicDirectory(groupId, groupName, refresh, context, listener);
|
||||
for (Entry entry : dir.getChildren(true, false)) {
|
||||
Artist artist = new Artist();
|
||||
artist.setId(entry.getId());
|
||||
artist.setName(entry.getTitle());
|
||||
artists.add(artist);
|
||||
}
|
||||
|
||||
Indexes indexes = new Indexes();
|
||||
|
@ -106,15 +106,6 @@ public class SelectPlaylistFragment extends SelectRecyclerFragment<Playlist> {
|
||||
|
||||
@Override
|
||||
public SectionAdapter<Playlist> getAdapter(List<Playlist> playlists) {
|
||||
List<Playlist> mine = new ArrayList<>();
|
||||
|
||||
String currentUsername = UserUtil.getCurrentUsername(context);
|
||||
for (Playlist playlist : playlists) {
|
||||
if (playlist.getOwner() == null || playlist.getOwner().equals(currentUsername)) {
|
||||
mine.add(playlist);
|
||||
}
|
||||
}
|
||||
|
||||
return new PlaylistAdapter(context, playlists, getImageLoader(), largeAlbums, this);
|
||||
}
|
||||
|
||||
|
@ -232,8 +232,6 @@ public class DownloadService extends Service {
|
||||
}
|
||||
} else if (level >= ComponentCallbacks2.TRIM_MEMORY_MODERATE) {
|
||||
imageLoader.onLowMemory(0.25f);
|
||||
} else if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
|
||||
imageLoader.onLowMemory(0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -336,7 +334,6 @@ public class DownloadService extends Service {
|
||||
}
|
||||
revision++;
|
||||
onSongsChanged();
|
||||
updateRemotePlaylist();
|
||||
|
||||
if (shuffle) {
|
||||
shuffle();
|
||||
@ -391,22 +388,6 @@ public class DownloadService extends Service {
|
||||
lifecycleSupport.serializeDownloadQueue();
|
||||
}
|
||||
|
||||
private synchronized void updateRemotePlaylist() {
|
||||
List<DownloadFile> playlist = new ArrayList<>();
|
||||
if (currentPlaying != null) {
|
||||
int index = downloadList.indexOf(currentPlaying);
|
||||
if (index == -1) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
int size = size();
|
||||
int end = index + REMOTE_PLAYLIST_TOTAL;
|
||||
for (int i = index; i < size && i < end; i++) {
|
||||
playlist.add(downloadList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void restore(List<MusicDirectory.Entry> songs, List<MusicDirectory.Entry> toDelete, int currentPlayingIndex, int currentPlayingPosition) {
|
||||
SharedPreferences prefs = Util.getPreferences(this);
|
||||
if (prefs.getBoolean(Constants.PREFERENCES_KEY_REMOVE_PLAYED, false)) {
|
||||
@ -481,7 +462,6 @@ public class DownloadService extends Service {
|
||||
revision++;
|
||||
onSongsChanged();
|
||||
lifecycleSupport.serializeDownloadQueue();
|
||||
updateRemotePlaylist();
|
||||
setNextPlaying();
|
||||
}
|
||||
|
||||
@ -551,7 +531,6 @@ public class DownloadService extends Service {
|
||||
}
|
||||
}
|
||||
lifecycleSupport.serializeDownloadQueue();
|
||||
updateRemotePlaylist();
|
||||
onSongsChanged();
|
||||
}
|
||||
|
||||
@ -589,7 +568,6 @@ public class DownloadService extends Service {
|
||||
}
|
||||
setCurrentPlaying(null);
|
||||
lifecycleSupport.serializeDownloadQueue();
|
||||
updateRemotePlaylist();
|
||||
setNextPlaying();
|
||||
if (proxy != null) {
|
||||
proxy.stop();
|
||||
@ -618,7 +596,6 @@ public class DownloadService extends Service {
|
||||
revision++;
|
||||
onSongsChanged();
|
||||
lifecycleSupport.serializeDownloadQueue();
|
||||
updateRemotePlaylist();
|
||||
if (downloadFile == nextPlaying) {
|
||||
setNextPlaying();
|
||||
}
|
||||
@ -873,7 +850,6 @@ public class DownloadService extends Service {
|
||||
proxy = null;
|
||||
}
|
||||
checkDownloads();
|
||||
updateRemotePlaylist();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1329,8 +1305,6 @@ public class DownloadService extends Service {
|
||||
setPlayerState(PAUSED);
|
||||
onSongProgress();
|
||||
}
|
||||
|
||||
updateRemotePlaylist();
|
||||
}
|
||||
|
||||
// Only call when starting, setPlayerState(PAUSED) already calls this
|
||||
@ -1650,7 +1624,6 @@ public class DownloadService extends Service {
|
||||
|
||||
if (revisionBefore != revision) {
|
||||
onSongsChanged();
|
||||
updateRemotePlaylist();
|
||||
}
|
||||
|
||||
if (wasEmpty && !downloadList.isEmpty()) {
|
||||
|
@ -49,11 +49,6 @@ public class UserParser extends AbstractParser {
|
||||
tagName = getElementName();
|
||||
if ("user".equals(tagName)) {
|
||||
user = new User();
|
||||
|
||||
for (String role : User.ROLES) {
|
||||
parseSetting(user, role);
|
||||
}
|
||||
|
||||
result.add(user);
|
||||
} else if ("error".equals(tagName)) {
|
||||
handleError();
|
||||
@ -92,11 +87,4 @@ public class UserParser extends AbstractParser {
|
||||
MusicService musicService = MusicServiceFactory.getMusicService(context);
|
||||
return musicService.getMusicFolders(false, context, null);
|
||||
}
|
||||
|
||||
private void parseSetting(User user, String name) {
|
||||
String value = get(name);
|
||||
if (value != null) {
|
||||
user.addSetting(name, "true".equals(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public final class MenuUtil {
|
||||
}
|
||||
// Apply similar logic to album views
|
||||
else if (updateView instanceof AlbumView || updateView instanceof ArtistView || updateView instanceof ArtistEntryView) {
|
||||
File folder = null;
|
||||
File folder;
|
||||
if (updateView instanceof AlbumView) {
|
||||
folder = ((AlbumView) updateView).getFile();
|
||||
} else if (updateView instanceof ArtistView) {
|
||||
|
@ -77,14 +77,9 @@ public class CacheLocationPreference extends EditTextPreference {
|
||||
for (File dir : dirs) {
|
||||
try {
|
||||
if (dir != null) {
|
||||
if (Environment.isExternalStorageRemovable(dir)) {
|
||||
} else {
|
||||
if (!Environment.isExternalStorageRemovable(dir)) {
|
||||
internalDir = dir;
|
||||
}
|
||||
|
||||
if (internalDir != null && null != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to check if is external", e);
|
||||
|
Loading…
Reference in New Issue
Block a user