diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-30 13:45:50 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-30 13:45:50 -0700 |
commit | bbf2b490cc6fc90fbd29715c2871082f5798c035 (patch) | |
tree | d97e605840d848727b652013af7a60e7ec5e938a | |
parent | e6cfc1f039d60c36ba95ecab7f8a4db779ce8a73 (diff) | |
download | dsub-bbf2b490cc6fc90fbd29715c2871082f5798c035.tar.gz dsub-bbf2b490cc6fc90fbd29715c2871082f5798c035.tar.bz2 dsub-bbf2b490cc6fc90fbd29715c2871082f5798c035.zip |
setRating just takes a Entry, add ratings + select bookmark icons, basic thumb down/up entry to now playing
36 files changed, 98 insertions, 23 deletions
diff --git a/res/drawable-hdpi/ic_action_rating_bad_dark.png b/res/drawable-hdpi/ic_action_rating_bad_dark.png Binary files differnew file mode 100644 index 00000000..855709e9 --- /dev/null +++ b/res/drawable-hdpi/ic_action_rating_bad_dark.png diff --git a/res/drawable-hdpi/ic_action_rating_bad_light.png b/res/drawable-hdpi/ic_action_rating_bad_light.png Binary files differnew file mode 100644 index 00000000..34199d3a --- /dev/null +++ b/res/drawable-hdpi/ic_action_rating_bad_light.png diff --git a/res/drawable-hdpi/ic_action_rating_bad_selected.png b/res/drawable-hdpi/ic_action_rating_bad_selected.png Binary files differnew file mode 100644 index 00000000..c57aba50 --- /dev/null +++ b/res/drawable-hdpi/ic_action_rating_bad_selected.png diff --git a/res/drawable-hdpi/ic_action_rating_good_dark.png b/res/drawable-hdpi/ic_action_rating_good_dark.png Binary files differnew file mode 100644 index 00000000..fa91e699 --- /dev/null +++ b/res/drawable-hdpi/ic_action_rating_good_dark.png diff --git a/res/drawable-hdpi/ic_action_rating_good_light.png b/res/drawable-hdpi/ic_action_rating_good_light.png Binary files differnew file mode 100644 index 00000000..3427d770 --- /dev/null +++ b/res/drawable-hdpi/ic_action_rating_good_light.png diff --git a/res/drawable-hdpi/ic_menu_bookmark_selected.png b/res/drawable-hdpi/ic_menu_bookmark_selected.png Binary files differnew file mode 100644 index 00000000..5a33d60c --- /dev/null +++ b/res/drawable-hdpi/ic_menu_bookmark_selected.png diff --git a/res/drawable-mdpi/ic_action_rating_bad_dark.png b/res/drawable-mdpi/ic_action_rating_bad_dark.png Binary files differnew file mode 100644 index 00000000..64f3cd1f --- /dev/null +++ b/res/drawable-mdpi/ic_action_rating_bad_dark.png diff --git a/res/drawable-mdpi/ic_action_rating_bad_light.png b/res/drawable-mdpi/ic_action_rating_bad_light.png Binary files differnew file mode 100644 index 00000000..d6c8d42a --- /dev/null +++ b/res/drawable-mdpi/ic_action_rating_bad_light.png diff --git a/res/drawable-mdpi/ic_action_rating_bad_selected.png b/res/drawable-mdpi/ic_action_rating_bad_selected.png Binary files differnew file mode 100644 index 00000000..34f5a9de --- /dev/null +++ b/res/drawable-mdpi/ic_action_rating_bad_selected.png diff --git a/res/drawable-mdpi/ic_action_rating_good_dark.png b/res/drawable-mdpi/ic_action_rating_good_dark.png Binary files differnew file mode 100644 index 00000000..cadfbe1e --- /dev/null +++ b/res/drawable-mdpi/ic_action_rating_good_dark.png diff --git a/res/drawable-mdpi/ic_action_rating_good_light.png b/res/drawable-mdpi/ic_action_rating_good_light.png Binary files differnew file mode 100644 index 00000000..75711920 --- /dev/null +++ b/res/drawable-mdpi/ic_action_rating_good_light.png diff --git a/res/drawable-mdpi/ic_menu_bookmark_selected.png b/res/drawable-mdpi/ic_menu_bookmark_selected.png Binary files differnew file mode 100644 index 00000000..efcc1afa --- /dev/null +++ b/res/drawable-mdpi/ic_menu_bookmark_selected.png diff --git a/res/drawable-xhdpi/ic_action_rating_bad_dark.png b/res/drawable-xhdpi/ic_action_rating_bad_dark.png Binary files differnew file mode 100644 index 00000000..1393be0c --- /dev/null +++ b/res/drawable-xhdpi/ic_action_rating_bad_dark.png diff --git a/res/drawable-xhdpi/ic_action_rating_bad_light.png b/res/drawable-xhdpi/ic_action_rating_bad_light.png Binary files differnew file mode 100644 index 00000000..fc1959b6 --- /dev/null +++ b/res/drawable-xhdpi/ic_action_rating_bad_light.png diff --git a/res/drawable-xhdpi/ic_action_rating_bad_selected.png b/res/drawable-xhdpi/ic_action_rating_bad_selected.png Binary files differnew file mode 100644 index 00000000..cf7802d5 --- /dev/null +++ b/res/drawable-xhdpi/ic_action_rating_bad_selected.png diff --git a/res/drawable-xhdpi/ic_action_rating_good_dark.png b/res/drawable-xhdpi/ic_action_rating_good_dark.png Binary files differnew file mode 100644 index 00000000..249ea9ec --- /dev/null +++ b/res/drawable-xhdpi/ic_action_rating_good_dark.png diff --git a/res/drawable-xhdpi/ic_action_rating_good_light.png b/res/drawable-xhdpi/ic_action_rating_good_light.png Binary files differnew file mode 100644 index 00000000..c8a776b0 --- /dev/null +++ b/res/drawable-xhdpi/ic_action_rating_good_light.png diff --git a/res/drawable-xhdpi/ic_menu_bookmark_selected.png b/res/drawable-xhdpi/ic_menu_bookmark_selected.png Binary files differnew file mode 100644 index 00000000..353b7b79 --- /dev/null +++ b/res/drawable-xhdpi/ic_menu_bookmark_selected.png diff --git a/res/drawable-xxhdpi/ic_action_rating_bad_dark.png b/res/drawable-xxhdpi/ic_action_rating_bad_dark.png Binary files differnew file mode 100644 index 00000000..d784b239 --- /dev/null +++ b/res/drawable-xxhdpi/ic_action_rating_bad_dark.png diff --git a/res/drawable-xxhdpi/ic_action_rating_bad_light.png b/res/drawable-xxhdpi/ic_action_rating_bad_light.png Binary files differnew file mode 100644 index 00000000..a1484d25 --- /dev/null +++ b/res/drawable-xxhdpi/ic_action_rating_bad_light.png diff --git a/res/drawable-xxhdpi/ic_action_rating_bad_selected.png b/res/drawable-xxhdpi/ic_action_rating_bad_selected.png Binary files differnew file mode 100644 index 00000000..13218a08 --- /dev/null +++ b/res/drawable-xxhdpi/ic_action_rating_bad_selected.png diff --git a/res/drawable-xxhdpi/ic_action_rating_good_dark.png b/res/drawable-xxhdpi/ic_action_rating_good_dark.png Binary files differnew file mode 100644 index 00000000..a332a632 --- /dev/null +++ b/res/drawable-xxhdpi/ic_action_rating_good_dark.png diff --git a/res/drawable-xxhdpi/ic_action_rating_good_light.png b/res/drawable-xxhdpi/ic_action_rating_good_light.png Binary files differnew file mode 100644 index 00000000..2ef75765 --- /dev/null +++ b/res/drawable-xxhdpi/ic_action_rating_good_light.png diff --git a/res/drawable-xxhdpi/ic_menu_bookmark_selected.png b/res/drawable-xxhdpi/ic_menu_bookmark_selected.png Binary files differnew file mode 100644 index 00000000..a1890fbb --- /dev/null +++ b/res/drawable-xxhdpi/ic_menu_bookmark_selected.png diff --git a/res/layout-land/download.xml b/res/layout-land/download.xml index eb876be0..c17abbc4 100644 --- a/res/layout-land/download.xml +++ b/res/layout-land/download.xml @@ -64,6 +64,11 @@ android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
+ <ImageButton
+ android:id="@+id/download_rating_bad"
+ style="@style/DownloadActionImageButton"
+ android:src="?attr/rating_bad"/>
+
<Button
android:id="@+id/download_equalizer"
android:text="EQ"
@@ -83,6 +88,11 @@ android:id="@+id/download_bookmark"
style="@style/DownloadActionImageButton"
android:src="?attr/bookmark"/>
+
+ <ImageButton
+ android:id="@+id/download_rating_good"
+ style="@style/DownloadActionImageButton"
+ android:src="?attr/rating_good"/>
</LinearLayout>
</LinearLayout>
diff --git a/res/layout-port/download.xml b/res/layout-port/download.xml index f2a1df1c..7cce6747 100644 --- a/res/layout-port/download.xml +++ b/res/layout-port/download.xml @@ -55,6 +55,11 @@ android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
+ <ImageButton
+ android:id="@+id/download_rating_bad"
+ style="@style/DownloadActionImageButton"
+ android:src="@drawable/ic_action_rating_bad_dark"/>
+
<Button
android:id="@+id/download_equalizer"
android:text="EQ"
@@ -74,6 +79,11 @@ android:id="@+id/download_bookmark"
style="@style/DownloadActionImageButton"
android:src="@drawable/ic_menu_bookmark_dark"/>
+
+ <ImageButton
+ android:id="@+id/download_rating_good"
+ style="@style/DownloadActionImageButton"
+ android:src="@drawable/ic_action_rating_good_dark"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml index ac535487..13456e18 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -23,5 +23,7 @@ <attr name="share" format="reference"/> <attr name="add_person" format="reference"/> <attr name="password" format="reference"/> + <attr name="rating_bad" format="reference"/> + <attr name="rating_good" format="reference"/> <attr name="drawerItemsIcons" format="reference"/> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index b02cdc9d..91d0435d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -242,6 +242,9 @@ <string name="bookmark.action_resume">Resume</string>
<string name="bookmark.action_start_over">Start Over</string>
+ <string name="rating.set_rating_failed">Failed to set rating for \"%s\"</string>
+ <string name="rating.remove_rating_failed">Failed to remove rating for \"%s\"</string>
+
<string name="song_details.error">Error</string>
<string name="song_details.skipped">Skipped</string>
<string name="song_details.downloading">Downloading</string>
diff --git a/res/values/themes.xml b/res/values/themes.xml index 1700aa88..129c0612 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -26,6 +26,8 @@ <item name="share">@drawable/ic_menu_share_light</item> <item name="add_person">@drawable/ic_menu_add_person_light</item> <item name="password">@drawable/ic_menu_password_light</item> + <item name="rating_bad">@drawable/ic_action_rating_bad_light</item> + <item name="rating_good">@drawable/ic_action_rating_good_light</item> <item name="drawerItemsIcons">@array/drawerItemIconsLight</item> <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> <item name="android:buttonStyle">@style/DSub.ButtonStyle.Light</item> @@ -57,6 +59,8 @@ <item name="share">@drawable/ic_menu_share_dark</item> <item name="add_person">@drawable/ic_menu_add_person_dark</item> <item name="password">@drawable/ic_menu_password_dark</item> + <item name="rating_bad">@drawable/ic_action_rating_bad_dark</item> + <item name="rating_good">@drawable/ic_action_rating_good_dark</item> <item name="drawerItemsIcons">@array/drawerItemIconsDark</item> <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> <item name="android:buttonStyle">@style/DSub.ButtonStyle.Dark</item> @@ -91,6 +95,8 @@ <item name="share">@drawable/ic_menu_share_dark</item> <item name="add_person">@drawable/ic_menu_add_person_dark</item> <item name="password">@drawable/ic_menu_password_dark</item> + <item name="rating_bad">@drawable/ic_action_rating_bad_dark</item> + <item name="rating_good">@drawable/ic_action_rating_good_dark</item> <item name="drawerItemsIcons">@array/drawerItemIconsDark</item> <item name="android:textViewStyle">@style/DSub.TextViewStyle</item> <item name="android:buttonStyle">@style/DSub.ButtonStyle.Dark</item> diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 90cc746c..868cdef1 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -71,6 +71,7 @@ import github.daneren2005.dsub.view.UpdateView; import github.daneren2005.dsub.util.Util;
import github.daneren2005.dsub.view.VisualizerView;
+import static github.daneren2005.dsub.domain.MusicDirectory.Entry;
import static github.daneren2005.dsub.domain.PlayerState.*;
import github.daneren2005.dsub.util.*;
import github.daneren2005.dsub.view.AutoRepeatButton;
@@ -113,6 +114,8 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis private View toggleListButton;
private ImageButton starButton;
private ImageButton bookmarkButton;
+ private ImageButton rateBadButton;
+ private ImageButton rateGoodButton;
private View mainLayout;
private ScheduledExecutorService executorService;
private DownloadFile currentPlaying;
@@ -185,6 +188,8 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis equalizerButton = (Button)rootView.findViewById(R.id.download_equalizer);
visualizerButton = (Button)rootView.findViewById(R.id.download_visualizer);
bookmarkButton = (ImageButton) rootView.findViewById(R.id.download_bookmark);
+ rateBadButton = (ImageButton) rootView.findViewById(R.id.download_rating_bad);
+ rateGoodButton = (ImageButton) rootView.findViewById(R.id.download_rating_good);
LinearLayout visualizerViewLayout = (LinearLayout)rootView.findViewById(R.id.download_visualizer_view_layout);
toggleListButton =rootView.findViewById(R.id.download_toggle_list);
@@ -195,7 +200,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis public void onClick(View v) {
DownloadFile currentDownload = getDownloadService().getCurrentPlaying();
if (currentDownload != null) {
- MusicDirectory.Entry currentSong = currentDownload.getSong();
+ Entry currentSong = currentDownload.getSong();
toggleStarred(currentSong);
starButton.setImageResource(currentSong.isStarred() ? android.R.drawable.btn_star_big_on : android.R.drawable.btn_star_big_off);
}
@@ -402,6 +407,21 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis }
});
+ rateBadButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Entry entry = getDownloadService().getCurrentPlaying().getSong();
+ setRating(entry, 1);
+ }
+ });
+ rateGoodButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Entry entry = getDownloadService().getCurrentPlaying().getSong();
+ setRating(entry, 5);
+ }
+ });
+
toggleListButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -595,7 +615,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis private boolean menuItemSelected(int menuItemId, final DownloadFile song) {
switch (menuItemId) {
case R.id.menu_show_album: case R.id.menu_show_artist:
- MusicDirectory.Entry entry = song.getSong();
+ Entry entry = song.getSong();
Intent intent = new Intent(context, SubsonicFragmentActivity.class);
intent.putExtra(Constants.INTENT_EXTRA_VIEW_ALBUM, true);
@@ -672,7 +692,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis }.execute();
return true;
case R.id.menu_delete:
- List<MusicDirectory.Entry> songs = new ArrayList<MusicDirectory.Entry>(1);
+ List<Entry> songs = new ArrayList<Entry>(1);
songs.add(song.getSong());
getDownloadService().delete(songs);
return true;
@@ -729,7 +749,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis }.execute();
return true;
case R.id.menu_save_playlist:
- List<MusicDirectory.Entry> entries = new LinkedList<MusicDirectory.Entry>();
+ List<Entry> entries = new LinkedList<Entry>();
for (DownloadFile downloadFile : getDownloadService().getSongs()) {
entries.add(downloadFile.getSong());
}
@@ -747,7 +767,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis }
return true;
case R.id.menu_add_playlist:
- songs = new ArrayList<MusicDirectory.Entry>(1);
+ songs = new ArrayList<Entry>(1);
songs.add(song.getSong());
addToPlaylist(songs);
return true;
@@ -755,7 +775,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis displaySongInfo(song.getSong());
return true;
case R.id.menu_share:
- songs = new ArrayList<MusicDirectory.Entry>(1);
+ songs = new ArrayList<Entry>(1);
songs.add(song.getSong());
createShare(songs);
default:
@@ -1130,7 +1150,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis @Override
protected void done(Void result) {
if (currentPlaying != null) {
- MusicDirectory.Entry song = currentPlaying.getSong();
+ Entry song = currentPlaying.getSong();
songTitleTextView.setText(song.getTitle());
getImageLoader().loadImage(albumArtImageView, song, true, true);
starButton.setImageResource(song.isStarred() ? android.R.drawable.btn_star_big_on : android.R.drawable.btn_star_big_off);
@@ -1317,13 +1337,13 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis new SilentBackgroundTask<Void>(context) {
@Override
protected Void doInBackground() throws Throwable {
- MusicDirectory.Entry currentSong = currentDownload.getSong();
+ Entry currentSong = currentDownload.getSong();
MusicService musicService = MusicServiceFactory.getMusicService(context);
int position = getDownloadService().getPlayerPosition();
musicService.createBookmark(currentSong.getId(), Util.getParentFromEntry(context, currentSong), position, comment, context, null);
currentSong.setBookmark(new Bookmark(position));
- MusicDirectory.Entry find = UpdateView.findEntry(currentSong);
+ Entry find = UpdateView.findEntry(currentSong);
if(find != null && find != currentSong) {
find.setBookmark(new Bookmark(position));
}
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 9e5d936b..92709bde 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -1494,4 +1494,29 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR }
});
}
+
+ protected void setRating(final Entry entry, final int rating) {
+ new SilentBackgroundTask<Void>(context) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ MusicService musicService = MusicServiceFactory.getMusicService(context);
+ musicService.setRating(entry, rating, context, null);
+
+ entry.setRating(rating);
+ return null;
+ }
+
+ @Override
+ protected void error(Throwable error) {
+ String msg;
+ if (error instanceof OfflineException || error instanceof ServerTooOldException) {
+ msg = getErrorMessage(error);
+ } else {
+ msg = context.getResources().getString(R.string.rating_set_rating_failed, entry.getTitle()) + " " + getErrorMessage(error);
+ }
+
+ Util.toast(context, msg, false);
+ }
+ }.execute();
+ }
}
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 3801da67..f68adb7b 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -792,10 +792,10 @@ public class CachedMusicService implements MusicService { } @Override - public void setRating(final String id, String parent, final int rating, Context context, ProgressListener progressListener) throws Exception { - musicService.setRating(id, parent, rating, context, progressListener); + public void setRating(final Entry entry, final int rating, Context context, ProgressListener progressListener) throws Exception { + musicService.setRating(entry, rating, context, progressListener); - new GenericSongUpdater(context, parent, id) { + new GenericSongUpdater(context, entry) { @Override public void updateResult(Entry result) { result.setRating(rating); @@ -1231,22 +1231,20 @@ public class CachedMusicService implements MusicService { } private abstract class GenericSongUpdater { Context context; - String id; - String parent; + Entry entry; - public GenericSongUpdater(Context context, String id, String parent) { + public GenericSongUpdater(Context context, Entry entry) { this.context = context; - this.id = id; - this.parent = parent; + this.entry = entry; } public boolean checkResult(Entry check) { - return id.equals(check.getId()); + return entry.getId().equals(check.getId()); } public abstract void updateResult(Entry result); public void execute() { - new MusicDirectoryUpdater(context, "directory", parent) { + new MusicDirectoryUpdater(context, "directory", entry.getParent()) { @Override public boolean checkResult(Entry check) { return GenericSongUpdater.this.checkResult(check); diff --git a/src/github/daneren2005/dsub/service/MusicService.java b/src/github/daneren2005/dsub/service/MusicService.java index 28b8bbfe..466ad477 100644 --- a/src/github/daneren2005/dsub/service/MusicService.java +++ b/src/github/daneren2005/dsub/service/MusicService.java @@ -152,7 +152,7 @@ public interface MusicService { void deletePodcastEpisode(String id, String parent, ProgressListener progressListener, Context context) throws Exception; - void setRating(String id, String parent, int rating, Context context, ProgressListener progressListener) throws Exception; + void setRating(MusicDirectory.Entry entry, int rating, Context context, ProgressListener progressListener) throws Exception; MusicDirectory getBookmarks(boolean refresh, Context context, ProgressListener progressListener) throws Exception; diff --git a/src/github/daneren2005/dsub/service/OfflineMusicService.java b/src/github/daneren2005/dsub/service/OfflineMusicService.java index 6ac21c35..e20a2b41 100644 --- a/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -737,7 +737,7 @@ public class OfflineMusicService implements MusicService { } @Override - public void setRating(String id, String parent, int rating, Context context, ProgressListener progressListener) throws Exception { + public void setRating(MusicDirectory.Entry entry, int rating, Context context, ProgressListener progressListener) throws Exception { throw new OfflineException(ERRORMSG); } diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index 4ec487a0..991ad5ee 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -1126,10 +1126,10 @@ public class RESTMusicService implements MusicService { } @Override - public void setRating(String id, String parent, int rating, Context context, ProgressListener progressListener) throws Exception { + public void setRating(MusicDirectory.Entry entry, int rating, Context context, ProgressListener progressListener) throws Exception { checkServerVersion(context, "1.6", "Setting ratings not supported."); - Reader reader = getReader(context, progressListener, "setRating", null, Arrays.asList("id", "rating"), Arrays.<Object>asList(id, rating)); + Reader reader = getReader(context, progressListener, "setRating", null, Arrays.asList("id", "rating"), Arrays.<Object>asList(entry.getId(), rating)); try { new ErrorParser(context, getInstance(context)).parse(reader); } finally { diff --git a/src/github/daneren2005/dsub/service/parser/MusicDirectoryEntryParser.java b/src/github/daneren2005/dsub/service/parser/MusicDirectoryEntryParser.java index 683f6857..9ca2c4e6 100644 --- a/src/github/daneren2005/dsub/service/parser/MusicDirectoryEntryParser.java +++ b/src/github/daneren2005/dsub/service/parser/MusicDirectoryEntryParser.java @@ -73,6 +73,7 @@ public class MusicDirectoryEntryParser extends AbstractParser { } else if("audiobook".equals(type)) { entry.setType(MusicDirectory.Entry.TYPE_AUDIO_BOOK); } + entry.setRating(getInteger("userRating")); } else if(!"".equals(artist)) { entry.setPath(artist + "/" + entry.getTitle()); } |