mirror of
https://gitea.mayex.net/mayekkuzu/Audinaut.git
synced 2025-01-23 12:44:54 +03:00
Remove unreachable statements
This commit is contained in:
parent
9f3ecd5e8e
commit
99c03d59b3
@ -768,11 +768,6 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
|
||||
}
|
||||
|
||||
public DownloadService getDownloadService() {
|
||||
boolean finished = false;
|
||||
if (finished) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If service is not available, request it to start and wait for it.
|
||||
for (int i = 0; i < 5; i++) {
|
||||
DownloadService downloadService = DownloadService.getInstance();
|
||||
|
@ -97,7 +97,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||
firstRun = true;
|
||||
}
|
||||
|
||||
if ("".equals(fragmentType) || fragmentType == null || firstRun) {
|
||||
if ("".equals(fragmentType) || firstRun) {
|
||||
// Initial startup stuff
|
||||
if (!sessionInitialized) {
|
||||
loadSession();
|
||||
@ -590,7 +590,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||
private boolean resetCacheLocation(SharedPreferences prefs) {
|
||||
String newDirectory = FileUtil.getDefaultMusicDirectory(this).getPath();
|
||||
String oldDirectory = prefs.getString(Constants.PREFERENCES_KEY_CACHE_LOCATION, null);
|
||||
if (newDirectory == null || (oldDirectory != null && newDirectory.equals(oldDirectory))) {
|
||||
if (oldDirectory != null && newDirectory.equals(oldDirectory)) {
|
||||
return false;
|
||||
} else {
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
|
@ -120,8 +120,6 @@ abstract class ExpandableSectionAdapter<T> extends SectionAdapter<T> {
|
||||
toggleSelectionView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (view != null) {
|
||||
view.setObject(header);
|
||||
}
|
||||
view.setObject(header);
|
||||
}
|
||||
}
|
||||
|
@ -76,8 +76,6 @@ public class MainAdapter extends SectionAdapter<Integer> {
|
||||
checkBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (view != null) {
|
||||
view.setObject(display);
|
||||
}
|
||||
view.setObject(display);
|
||||
}
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
|
||||
PlayerState state = service.getPlayerState();
|
||||
if (state == PAUSED || state == COMPLETED || state == STOPPED) {
|
||||
service.start();
|
||||
} else if (state == STOPPED || state == IDLE) {
|
||||
} else if (state == IDLE) {
|
||||
warnIfStorageUnavailable();
|
||||
int current = service.getCurrentPlayingIndex();
|
||||
// TODO: Use play() method.
|
||||
|
@ -85,9 +85,6 @@ public abstract class PreferenceCompatFragment extends SubsonicFragment {
|
||||
}
|
||||
|
||||
mList = (ListView) listView;
|
||||
if (mList == null) {
|
||||
throw new RuntimeException("Your content must have a ListView whose id attribute is 'android.R.id.list'");
|
||||
}
|
||||
|
||||
mHandler.post(mRequestFocus);
|
||||
}
|
||||
|
@ -661,8 +661,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
}.execute();
|
||||
}
|
||||
});
|
||||
_useCombo = true;
|
||||
final boolean useCombo = _useCombo;
|
||||
final boolean useCombo = true;
|
||||
|
||||
startYearBox.setText(oldStartYear);
|
||||
endYearBox.setText(oldEndYear);
|
||||
@ -674,11 +673,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
.setView(dialogView)
|
||||
.setPositiveButton(R.string.common_ok, (dialog, id) -> {
|
||||
String genre;
|
||||
if (useCombo) {
|
||||
genre = genreCombo.getText().toString();
|
||||
} else {
|
||||
genre = genreBox.getText().toString();
|
||||
}
|
||||
genre = genreCombo.getText().toString();
|
||||
String startYear = startYearBox.getText().toString();
|
||||
String endYear = endYearBox.getText().toString();
|
||||
|
||||
@ -1051,14 +1046,9 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
size = file.length();
|
||||
|
||||
// If no duration try to read bitrate tag
|
||||
if (duration == null) {
|
||||
tmp = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE);
|
||||
bitrate = Integer.parseInt((tmp != null) ? tmp : "0") / 1000;
|
||||
} else {
|
||||
// Otherwise do a calculation for it
|
||||
// Divide by 1000 so in kbps
|
||||
bitrate = (int) (size / duration) / 1000 * 8;
|
||||
}
|
||||
// Otherwise do a calculation for it
|
||||
// Divide by 1000 so in kbps
|
||||
bitrate = (int) (size / duration) / 1000 * 8;
|
||||
|
||||
if (Util.isOffline(context)) {
|
||||
song.setGenre(metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_GENRE));
|
||||
|
@ -66,9 +66,6 @@ public class AudinautSearchProvider extends ContentProvider {
|
||||
|
||||
private SearchResult search(String query) {
|
||||
MusicService musicService = MusicServiceFactory.getMusicService(getContext());
|
||||
if (musicService == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return musicService.search(new SearchCritera(query, 5, 10, 10), getContext(), null);
|
||||
|
@ -935,7 +935,7 @@ public class DownloadService extends Service {
|
||||
private int seekToWrapper(int difference) {
|
||||
int msPlayed = Math.max(0, getPlayerPosition());
|
||||
Integer duration = getPlayerDuration();
|
||||
int msTotal = duration == null ? 0 : duration;
|
||||
int msTotal = duration;
|
||||
|
||||
int seekTo;
|
||||
if (msPlayed + difference > msTotal) {
|
||||
|
@ -67,12 +67,10 @@ public class GenreParser extends AbstractParser {
|
||||
} else if (eventType == XmlPullParser.TEXT) {
|
||||
if (genre != null) {
|
||||
String value = getText();
|
||||
if (genre != null) {
|
||||
genre.setName(Html.fromHtml(value).toString());
|
||||
genre.setIndex(value.substring(0, 1));
|
||||
result.add(genre);
|
||||
genre = null;
|
||||
}
|
||||
genre.setName(Html.fromHtml(value).toString());
|
||||
genre.setIndex(value.substring(0, 1));
|
||||
result.add(genre);
|
||||
genre = null;
|
||||
}
|
||||
}
|
||||
} while (eventType != XmlPullParser.END_DOCUMENT);
|
||||
|
@ -637,15 +637,6 @@ public class FileUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (0 != 0) {
|
||||
Date fileDate = new Date(file.lastModified());
|
||||
// Convert into hours
|
||||
long age = (new Date().getTime() - fileDate.getTime()) / 1000 / 3600;
|
||||
if (age > 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
RandomAccessFile randomFile = new RandomAccessFile(file, "r");
|
||||
|
||||
in = new Input(new FileInputStream(randomFile.getFD()));
|
||||
|
@ -65,7 +65,7 @@ public final class MenuUtil {
|
||||
folder = ((AlbumView) updateView).getFile();
|
||||
} else if (updateView instanceof ArtistView) {
|
||||
folder = ((ArtistView) updateView).getFile();
|
||||
} else if (updateView instanceof ArtistEntryView) {
|
||||
} else {
|
||||
folder = ((ArtistEntryView) updateView).getFile();
|
||||
}
|
||||
|
||||
|
@ -199,31 +199,19 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
|
||||
boolean playing = Util.equals(downloadService.getCurrentPlaying(), downloadFile);
|
||||
if (playing) {
|
||||
if (!this.playing) {
|
||||
this.playing = playing;
|
||||
this.playing = true;
|
||||
playingTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
if (this.playing) {
|
||||
this.playing = playing;
|
||||
this.playing = false;
|
||||
playingTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isPlayed = false;
|
||||
if (isPlayed) {
|
||||
if (!isPlayedShown) {
|
||||
if (playedButton.getDrawable() == null) {
|
||||
playedButton.setImageDrawable(DrawableTint.getTintedDrawable(context));
|
||||
}
|
||||
|
||||
playedButton.setVisibility(View.VISIBLE);
|
||||
isPlayedShown = true;
|
||||
}
|
||||
} else {
|
||||
if (isPlayedShown) {
|
||||
playedButton.setVisibility(View.GONE);
|
||||
isPlayedShown = false;
|
||||
}
|
||||
if (isPlayedShown) {
|
||||
playedButton.setVisibility(View.GONE);
|
||||
isPlayedShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user