Fixed rating from notification
This commit is contained in:
parent
ab624be93d
commit
99dbf236c9
|
@ -1660,32 +1660,9 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
|
||||||
private void setSongRating(final int rating)
|
private void setSongRating(final int rating)
|
||||||
{
|
{
|
||||||
if (currentSong == null)
|
if (currentSong == null)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
final String id = currentSong.getId();
|
|
||||||
|
|
||||||
currentSong.setUserRating(rating);
|
|
||||||
displaySongRating();
|
displaySongRating();
|
||||||
getDownloadService().updateNotification();
|
getDownloadService().setSongRating(rating);
|
||||||
|
|
||||||
new Thread(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
final MusicService musicService = MusicServiceFactory.getMusicService(DownloadActivity.this);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
musicService.setRating(id, rating, DownloadActivity.this, null);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.e(TAG, e.getMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,4 +146,6 @@ public interface DownloadService
|
||||||
void startJukeboxService();
|
void startJukeboxService();
|
||||||
|
|
||||||
void updateNotification();
|
void updateNotification();
|
||||||
|
|
||||||
|
void setSongRating(final int rating);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2159,12 +2159,33 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
||||||
|
|
||||||
public void setSongRating(final int rating)
|
public void setSongRating(final int rating)
|
||||||
{
|
{
|
||||||
if (!new FeatureStorage(this).isFeatureEnabled(Feature.FIVE_STAR_RATING))
|
if (!KoinJavaComponent.get(FeatureStorage.class).isFeatureEnabled(Feature.FIVE_STAR_RATING))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (currentPlaying == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
final Entry song = currentPlaying.getSong();
|
final Entry song = currentPlaying.getSong();
|
||||||
song.setUserRating(rating);
|
song.setUserRating(rating);
|
||||||
|
|
||||||
|
new Thread(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
final MusicService musicService = MusicServiceFactory.getMusicService(DownloadServiceImpl.this);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
musicService.setRating(song.getId(), rating, DownloadServiceImpl.this, null);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.e(TAG, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
|
||||||
updateNotification();
|
updateNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue