Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string name="path_label">Path to check for new files:</string>
<string name="progress_completed_label">Completed, ready to start another scan.</string>
<string name="progress_error_bad_path_label">Scan failed: bad path specified for new file search.</string>
<string name="progress_error_nomedia_in_root">Attention:\nThe path contains a hidden file named \".nomedia\", which prevents the system from scanning media.\nFor a successful scan, this file must be removed.</string>
<string name="progress_filelist_label">Preparing initial list of files...</string>
<string name="progress_database_label">Querying database...</string>
<string name="progress_unstarted_label">Not yet started.</string>
Expand Down
15 changes: 13 additions & 2 deletions src/com/gmail/jerickson314/sdscanner/ScanFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,22 @@ public void startScan(File path, boolean restrictDbUpdate) {
updateProgressText(R.string.progress_filelist_label);
mFilesToProcess = new TreeSet<File>();
resetDebugMessages();
int progMsg = -1;
if (path.exists()) {
this.new PreprocessTask().execute(new ScanParameters(path, restrictDbUpdate));
File nomediaFile = new File(path.getPath(), ".nomedia");
if ( nomediaFile.exists() ) {
progMsg = R.string.progress_error_nomedia_in_root;
}
else {
this.new PreprocessTask().execute(new ScanParameters(path, restrictDbUpdate));
}
}
else {
updateProgressText(R.string.progress_error_bad_path_label);
progMsg = R.string.progress_error_bad_path_label;
}

if (progMsg != -1) {
updateProgressText(progMsg);
updateStartButtonEnabled(true);
signalFinished();
}
Expand Down