aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml1
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java7
2 files changed, 8 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bcd4917a..789e632f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -142,6 +142,7 @@
<string name="select_album.searching">Searching...</string>
<string name="select_album.no_sdcard">Error: No SD card available.</string>
<string name="select_album.no_network">Warning: No network available.</string>
+ <string name="select_album.no_room">Warning: you only have %s left</string>
<string name="select_album.not_licensed">Server not licensed. %d trial days left.</string>
<string name="select_album.donate_dialog_message">Get unlimited downloads by donating to Subsonic.</string>
<string name="select_album.donate_dialog_now">Now</string>
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 3a703b89..d4b222b2 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -29,6 +29,7 @@ import android.content.pm.ResolveInfo;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.os.Bundle;
+import android.os.StatFs;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
@@ -623,6 +624,12 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
if (!Util.isExternalStoragePresent()) {
Util.toast(context, R.string.select_album_no_sdcard);
}
+
+ StatFs stat = new StatFs(FileUtil.getMusicDirectory(context).getPath());
+ long bytesAvailableFs = (long) stat.getAvailableBlocks() * (long) stat.getBlockSize();
+ if(bytesAvailableFs < 50000000L) {
+ Util.toast(context, context.getResources().getString(R.string.select_album_no_room, Util.formatBytes(bytesAvailableFs)));
+ }
}
protected void onShuffleRequested() {