diff --git a/app/src/main/java/com/miz/abstractclasses/AbstractFileSource.java b/app/src/main/java/com/miz/abstractclasses/AbstractFileSource.java index 81b73265..3864fa02 100644 --- a/app/src/main/java/com/miz/abstractclasses/AbstractFileSource.java +++ b/app/src/main/java/com/miz/abstractclasses/AbstractFileSource.java @@ -30,7 +30,7 @@ public abstract class AbstractFileSource { protected T mFolder; protected FileSource mFileSource = null; protected Context mContext; - protected boolean mSubFolderSearch, mClearLibrary; + protected boolean mClearLibrary; protected int mFileSizeLimit; public void setFolder(T folder) { @@ -53,10 +53,6 @@ public Context getContext() { return mContext; } - public boolean searchSubFolders() { - return mSubFolderSearch; - } - public boolean clearLibrary() { return mClearLibrary; } diff --git a/app/src/main/java/com/miz/abstractclasses/MovieFileSource.java b/app/src/main/java/com/miz/abstractclasses/MovieFileSource.java index 046f39f3..75610336 100644 --- a/app/src/main/java/com/miz/abstractclasses/MovieFileSource.java +++ b/app/src/main/java/com/miz/abstractclasses/MovieFileSource.java @@ -34,10 +34,9 @@ public abstract class MovieFileSource extends AbstractFileSource { protected List mDbMovies = new ArrayList(); - public MovieFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { + public MovieFileSource(Context context, FileSource fileSource, boolean clearLibrary) { mContext = context; mFileSource = fileSource; - mSubFolderSearch = subFolderSearch; mClearLibrary = clearLibrary; mFileSizeLimit = MizLib.getFileSizeLimit(getContext()); diff --git a/app/src/main/java/com/miz/abstractclasses/TvShowFileSource.java b/app/src/main/java/com/miz/abstractclasses/TvShowFileSource.java index a9e1881f..1bc51a06 100644 --- a/app/src/main/java/com/miz/abstractclasses/TvShowFileSource.java +++ b/app/src/main/java/com/miz/abstractclasses/TvShowFileSource.java @@ -33,10 +33,9 @@ public abstract class TvShowFileSource extends AbstractFileSource { protected List mDbEpisode = new ArrayList(); - public TvShowFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { + public TvShowFileSource(Context context, FileSource fileSource, boolean clearLibrary) { mContext = context; mFileSource = fileSource; - mSubFolderSearch = subFolderSearch; mClearLibrary = clearLibrary; mFileSizeLimit = MizLib.getFileSizeLimit(getContext()); diff --git a/app/src/main/java/com/miz/filesources/FileMovie.java b/app/src/main/java/com/miz/filesources/FileMovie.java index 597ff3fa..6535c3b2 100644 --- a/app/src/main/java/com/miz/filesources/FileMovie.java +++ b/app/src/main/java/com/miz/filesources/FileMovie.java @@ -41,8 +41,8 @@ public class FileMovie extends MovieFileSource { private HashMap existingMovies = new HashMap(); private File tempFile; - public FileMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public FileMovie(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override @@ -55,7 +55,7 @@ public void removeUnidentifiedFiles() { if (!dbMovies.get(i).isNetworkFile() && !dbMovies.get(i).isUpnpFile()) { temp = new File(dbMovies.get(i).getFilepath()); if (temp.exists() && dbMovies.get(i).isUnidentified()) - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); } } } @@ -70,7 +70,7 @@ public void removeUnavailableFiles() { if (!dbMovies.get(i).isNetworkFile()) { temp = new File(dbMovies.get(i).getFilepath()); if (!temp.exists()) { - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); } } } @@ -82,7 +82,7 @@ public List searchFolder() { DbAdapterMovieMappings dbHelper = MizuuApplication.getMovieMappingAdapter(); Cursor cursor = dbHelper.getAllFilepaths(false); // Query database to return all filepaths in a cursor ColumnIndexCache cache = new ColumnIndexCache(); - + try { while (cursor.moveToNext()) {// Add all movies in cursor to ArrayList of all existing movies existingMovies.put(cursor.getString(cache.getColumnIndex(cursor, DbAdapterMovieMappings.KEY_FILEPATH)), ""); @@ -110,54 +110,48 @@ public List searchFolder() { @Override public void recursiveSearch(File folder, TreeSet results) { try { - if (searchSubFolders()) { - if (folder.isDirectory()) { - // Check if this is a DVD folder - if (folder.getName().equalsIgnoreCase("video_ts")) { - File[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) { - if (children[i].getName().equalsIgnoreCase("video_ts.ifo")) - addToResults(children[i], results); - } - } // Check if this is a Blu-ray folder - else if (folder.getName().equalsIgnoreCase("bdmv")) { - File[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) { - if (children[i].getName().equalsIgnoreCase("stream")) { - File[] m2tsVideoFiles = children[i].listFiles(); - - if (m2tsVideoFiles.length > 0) { - File largestFile = m2tsVideoFiles[0]; - - for (int j = 0; j < m2tsVideoFiles.length; j++) - if (largestFile.length() < m2tsVideoFiles[j].length()) - largestFile = m2tsVideoFiles[j]; - - addToResults(largestFile, results); - } + if (folder.isDirectory()) { + // Check if this is a DVD folder + if (folder.getName().equalsIgnoreCase("video_ts")) { + File[] children = folder.listFiles(); + for (int i = 0; i < children.length; i++) { + if (children[i].getName().equalsIgnoreCase("video_ts.ifo")) + addToResults(children[i], results); + } + } // Check if this is a Blu-ray folder + else if (folder.getName().equalsIgnoreCase("bdmv")) { + File[] children = folder.listFiles(); + for (int i = 0; i < children.length; i++) { + if (children[i].getName().equalsIgnoreCase("stream")) { + File[] m2tsVideoFiles = children[i].listFiles(); + + if (m2tsVideoFiles.length > 0) { + File largestFile = m2tsVideoFiles[0]; + + for (int j = 0; j < m2tsVideoFiles.length; j++) + if (largestFile.length() < m2tsVideoFiles[j].length()) + largestFile = m2tsVideoFiles[j]; + + addToResults(largestFile, results); } } - } else { - String[] childs = folder.list(); - for (int i = 0; i < childs.length; i++) { - tempFile = new File(folder.getAbsolutePath(), childs[i]); - recursiveSearch(tempFile, results); - } } } else { - addToResults(folder, results); + String[] childs = folder.list(); + for (int i = 0; i < childs.length; i++) { + tempFile = new File(folder.getAbsolutePath(), childs[i]); + recursiveSearch(tempFile, results); + } } } else { - File[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) - addToResults(children[i], results); + addToResults(folder, results); } } catch (Exception e) {} } @Override public void addToResults(File file, TreeSet results) { - if (MizLib.checkFileTypes(file.getAbsolutePath())) { + if (MizLib.checkFileTypes(file.getAbsolutePath())) { if (file.length() < getFileSizeLimit() && !file.getName().equalsIgnoreCase("video_ts.ifo")) return; diff --git a/app/src/main/java/com/miz/filesources/FileTvShow.java b/app/src/main/java/com/miz/filesources/FileTvShow.java index 8680ac39..06bf36ed 100644 --- a/app/src/main/java/com/miz/filesources/FileTvShow.java +++ b/app/src/main/java/com/miz/filesources/FileTvShow.java @@ -41,8 +41,8 @@ public class FileTvShow extends TvShowFileSource { private HashMap existingEpisodes = new HashMap(); private File tempFile; - public FileTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public FileTvShow(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override @@ -149,20 +149,14 @@ public List searchFolder() { @Override public void recursiveSearch(File folder, TreeSet results) { try { - if (searchSubFolders()) { - if (folder.isDirectory()) { - String[] childs = folder.list(); - for (int i = 0; i < childs.length; i++) { - tempFile = new File(folder.getAbsolutePath() + "/" + childs[i]); - recursiveSearch(tempFile, results); - } - } else { - addToResults(folder, results); + if (folder.isDirectory()) { + String[] childs = folder.list(); + for (int i = 0; i < childs.length; i++) { + tempFile = new File(folder.getAbsolutePath() + "/" + childs[i]); + recursiveSearch(tempFile, results); } } else { - File[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) - addToResults(children[i], results); + addToResults(folder, results); } } catch (Exception e) {} } diff --git a/app/src/main/java/com/miz/filesources/SmbMovie.java b/app/src/main/java/com/miz/filesources/SmbMovie.java index 3dba8f05..2f102fd7 100644 --- a/app/src/main/java/com/miz/filesources/SmbMovie.java +++ b/app/src/main/java/com/miz/filesources/SmbMovie.java @@ -43,8 +43,8 @@ public class SmbMovie extends MovieFileSource { private HashMap existingMovies = new HashMap(); private SmbFile tempSmbFile; - public SmbMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public SmbMovie(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override @@ -70,7 +70,7 @@ public void removeUnidentifiedFiles() { if (source == null) { if (dbMovies.get(i).isUnidentified()) - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); continue; } @@ -81,10 +81,10 @@ public void removeUnidentifiedFiles() { source.getPassword(), dbMovies.get(i).getFilepath(), false - )); + )); if (temp.exists() && dbMovies.get(i).isUnidentified()) - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); } catch (Exception e) {} // Do nothing - the file isn't available (either MalformedURLException or SmbException) } } @@ -112,7 +112,7 @@ public void removeUnavailableFiles() { } if (source == null) { - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); continue; } @@ -123,10 +123,10 @@ public void removeUnavailableFiles() { source.getPassword(), dbMovies.get(i).getFilepath(), false - )); + )); if (!temp.exists()) { - MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); + MovieDatabaseUtils.deleteMovie(mContext, dbMovies.get(i).getTmdbId()); } } catch (Exception e) {} // Do nothing - the file isn't available (either MalformedURLException or SmbException) } @@ -145,7 +145,7 @@ public List searchFolder() { DbAdapterMovieMappings dbHelper = MizuuApplication.getMovieMappingAdapter(); Cursor cursor = dbHelper.getAllFilepaths(false); // Query database to return all filepaths in a cursor ColumnIndexCache cache = new ColumnIndexCache(); - + try { while (cursor.moveToNext()) {// Add all movies in cursor to ArrayList of all existing movies existingMovies.put(cursor.getString(cache.getColumnIndex(cursor, DbAdapterMovieMappings.KEY_FILEPATH)), ""); @@ -173,52 +173,46 @@ public List searchFolder() { @Override public void recursiveSearch(SmbFile folder, TreeSet results) { try { - if (searchSubFolders()) { - if (folder.isDirectory()) { - // Check if this is a DVD folder - if (folder.getName().equalsIgnoreCase("video_ts/")) { - SmbFile[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) { - if (children[i].getName().equalsIgnoreCase("video_ts.ifo")) - addToResults(children[i], results); - } - } // Check if this is a Blu-ray folder - else if (folder.getName().equalsIgnoreCase("bdmv/")) { - SmbFile[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) { - if (children[i].getName().equalsIgnoreCase("stream/")) { - SmbFile[] m2tsVideoFiles = children[i].listFiles(); - - if (m2tsVideoFiles.length > 0) { - SmbFile largestFile = m2tsVideoFiles[0]; - - for (int j = 0; j < m2tsVideoFiles.length; j++) - if (largestFile.length() < m2tsVideoFiles[j].length()) - largestFile = m2tsVideoFiles[j]; - - addToResults(largestFile, results); - } - } - } - } else { - String[] childs = folder.list(); - for (int i = 0; i < childs.length; i++) { - tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i] + "/"); - if (tempSmbFile.isDirectory()) { - recursiveSearch(tempSmbFile, results); - } else { - tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i]); - addToResults(tempSmbFile, results); + if (folder.isDirectory()) { + // Check if this is a DVD folder + if (folder.getName().equalsIgnoreCase("video_ts/")) { + SmbFile[] children = folder.listFiles(); + for (int i = 0; i < children.length; i++) { + if (children[i].getName().equalsIgnoreCase("video_ts.ifo")) + addToResults(children[i], results); + } + } // Check if this is a Blu-ray folder + else if (folder.getName().equalsIgnoreCase("bdmv/")) { + SmbFile[] children = folder.listFiles(); + for (int i = 0; i < children.length; i++) { + if (children[i].getName().equalsIgnoreCase("stream/")) { + SmbFile[] m2tsVideoFiles = children[i].listFiles(); + + if (m2tsVideoFiles.length > 0) { + SmbFile largestFile = m2tsVideoFiles[0]; + + for (int j = 0; j < m2tsVideoFiles.length; j++) + if (largestFile.length() < m2tsVideoFiles[j].length()) + largestFile = m2tsVideoFiles[j]; + + addToResults(largestFile, results); } } } } else { - addToResults(folder, results); + String[] childs = folder.list(); + for (int i = 0; i < childs.length; i++) { + tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i] + "/"); + if (tempSmbFile.isDirectory()) { + recursiveSearch(tempSmbFile, results); + } else { + tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i]); + addToResults(tempSmbFile, results); + } + } } } else { - SmbFile[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) - addToResults(children[i], results); + addToResults(folder, results); } } catch (Exception e) {} } @@ -248,14 +242,14 @@ public void addToResults(SmbFile file, TreeSet results) { public SmbFile getRootFolder() { try { FileSource fs = getFileSource(); - return new SmbFile( + return new SmbFile( MizLib.createSmbLoginString( fs.getDomain(), fs.getUser(), fs.getPassword(), fs.getFilepath(), true - )); + )); } catch (Exception e) {} return null; } diff --git a/app/src/main/java/com/miz/filesources/SmbTvShow.java b/app/src/main/java/com/miz/filesources/SmbTvShow.java index f07e148e..359d0507 100644 --- a/app/src/main/java/com/miz/filesources/SmbTvShow.java +++ b/app/src/main/java/com/miz/filesources/SmbTvShow.java @@ -44,8 +44,8 @@ public class SmbTvShow extends TvShowFileSource { private HashMap existingEpisodes = new HashMap(); private SmbFile tempSmbFile; - public SmbTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public SmbTvShow(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override @@ -214,25 +214,19 @@ public List searchFolder() { @Override public void recursiveSearch(SmbFile folder, TreeSet results) { try { - if (searchSubFolders()) { - if (folder.isDirectory()) { - String[] childs = folder.list(); - for (int i = 0; i < childs.length; i++) { - tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i] + "/"); - if (tempSmbFile.isDirectory()) { - recursiveSearch(tempSmbFile, results); - } else { - tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i]); - addToResults(tempSmbFile, results); - } + if (folder.isDirectory()) { + String[] childs = folder.list(); + for (int i = 0; i < childs.length; i++) { + tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i] + "/"); + if (tempSmbFile.isDirectory()) { + recursiveSearch(tempSmbFile, results); + } else { + tempSmbFile = new SmbFile(folder.getCanonicalPath() + childs[i]); + addToResults(tempSmbFile, results); } - } else { - addToResults(folder, results); } } else { - SmbFile[] children = folder.listFiles(); - for (int i = 0; i < children.length; i++) - addToResults(children[i], results); + addToResults(folder, results); } } catch (Exception e) {} } diff --git a/app/src/main/java/com/miz/filesources/UpnpMovie.java b/app/src/main/java/com/miz/filesources/UpnpMovie.java index 5dfc5e30..c5c6b743 100644 --- a/app/src/main/java/com/miz/filesources/UpnpMovie.java +++ b/app/src/main/java/com/miz/filesources/UpnpMovie.java @@ -26,7 +26,6 @@ import com.miz.abstractclasses.MovieFileSource; import com.miz.db.DbAdapterMovieMappings; -import com.miz.db.DbAdapterMovies; import com.miz.functions.ColumnIndexCache; import com.miz.functions.DbMovie; import com.miz.functions.FileSource; @@ -68,8 +67,8 @@ public class UpnpMovie extends MovieFileSource { private CountDownLatch mLatch = new CountDownLatch(1); private AndroidUpnpService mUpnpService; - public UpnpMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public UpnpMovie(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override diff --git a/app/src/main/java/com/miz/filesources/UpnpTvShow.java b/app/src/main/java/com/miz/filesources/UpnpTvShow.java index f4d9b17f..fdf0af29 100644 --- a/app/src/main/java/com/miz/filesources/UpnpTvShow.java +++ b/app/src/main/java/com/miz/filesources/UpnpTvShow.java @@ -68,8 +68,8 @@ public class UpnpTvShow extends TvShowFileSource { private CountDownLatch mLatch = new CountDownLatch(1); private AndroidUpnpService mUpnpService; - public UpnpTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) { - super(context, fileSource, subFolderSearch, clearLibrary); + public UpnpTvShow(Context context, FileSource fileSource, boolean clearLibrary) { + super(context, fileSource, clearLibrary); } @Override diff --git a/app/src/main/java/com/miz/functions/PreferenceKeys.java b/app/src/main/java/com/miz/functions/PreferenceKeys.java index 7080df36..eec99c44 100644 --- a/app/src/main/java/com/miz/functions/PreferenceKeys.java +++ b/app/src/main/java/com/miz/functions/PreferenceKeys.java @@ -43,7 +43,6 @@ private PreferenceKeys() {} // No instantiation public static final String TMDB_BASE_URL_TIME = "tmdbBaseUrlTime"; public static final String CLEAR_LIBRARY_TVSHOWS = "prefsClearLibraryTv"; public static final String CLEAR_LIBRARY_MOVIES = "prefsClearLibrary"; - public static final String ENABLE_SUBFOLDER_SEARCH = "prefsEnableSubFolderSearch"; public static final String REMOVE_UNAVAILABLE_FILES_TVSHOWS = "prefsRemoveUnavailableTv"; public static final String REMOVE_UNAVAILABLE_FILES_MOVIES = "prefsRemoveUnavailable"; public static final String IGNORE_VIDEO_FILE_TYPE = "prefsIgnoreFileType"; diff --git a/app/src/main/java/com/miz/service/MovieLibraryUpdate.java b/app/src/main/java/com/miz/service/MovieLibraryUpdate.java index fa23cdb2..73bc7b0f 100644 --- a/app/src/main/java/com/miz/service/MovieLibraryUpdate.java +++ b/app/src/main/java/com/miz/service/MovieLibraryUpdate.java @@ -56,7 +56,6 @@ import java.util.List; import static com.miz.functions.PreferenceKeys.CLEAR_LIBRARY_MOVIES; -import static com.miz.functions.PreferenceKeys.ENABLE_SUBFOLDER_SEARCH; import static com.miz.functions.PreferenceKeys.REMOVE_UNAVAILABLE_FILES_MOVIES; import static com.miz.functions.PreferenceKeys.SYNC_WITH_TRAKT; @@ -66,7 +65,7 @@ public class MovieLibraryUpdate extends IntentService implements MovieLibraryUpd private ArrayList mFileSources; private ArrayList> mMovieFileSources; private ArrayList mMovieQueue = new ArrayList(); - private boolean mClearLibrary, mSearchSubfolders, mClearUnavailable, mSyncLibraries, mStopUpdate; + private boolean mClearLibrary, mClearUnavailable, mSyncLibraries, mStopUpdate; private int mTotalFiles, mCount; private SharedPreferences mSettings; private Editor mEditor; @@ -128,7 +127,7 @@ protected void onHandleIntent(Intent intent) { log("setupMovieFileSources()"); // Add the different file sources to the MovieFileSource ArrayList - setupMovieFileSources(mSearchSubfolders, mClearLibrary); + setupMovieFileSources(mClearLibrary); if (mStopUpdate) return; @@ -221,19 +220,19 @@ private void loadFileSources() { } } - private void setupMovieFileSources(boolean mSearchSubfolders, boolean mClearLibrary) { + private void setupMovieFileSources(boolean mClearLibrary) { for (FileSource fileSource : mFileSources) { if (mStopUpdate) return; switch (fileSource.getFileSourceType()) { case FileSource.FILE: - mMovieFileSources.add(new FileMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mMovieFileSources.add(new FileMovie(getApplicationContext(), fileSource, mClearLibrary)); break; case FileSource.SMB: - mMovieFileSources.add(new SmbMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mMovieFileSources.add(new SmbMovie(getApplicationContext(), fileSource, mClearLibrary)); break; case FileSource.UPNP: - mMovieFileSources.add(new UpnpMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mMovieFileSources.add(new UpnpMovie(getApplicationContext(), fileSource, mClearLibrary)); break; } } @@ -309,7 +308,6 @@ private void setup() { mSettings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); mClearLibrary = mSettings.getBoolean(CLEAR_LIBRARY_MOVIES, false); - mSearchSubfolders = mSettings.getBoolean(ENABLE_SUBFOLDER_SEARCH, true); mClearUnavailable = mSettings.getBoolean(REMOVE_UNAVAILABLE_FILES_MOVIES, false); mSyncLibraries = mSettings.getBoolean(SYNC_WITH_TRAKT, true); } @@ -337,7 +335,6 @@ private void clear() { // Booleans mClearLibrary = false; - mSearchSubfolders = true; mClearUnavailable = false; mSyncLibraries = true; mStopUpdate = false; diff --git a/app/src/main/java/com/miz/service/TvShowsLibraryUpdate.java b/app/src/main/java/com/miz/service/TvShowsLibraryUpdate.java index d808d2a7..ea0561b2 100644 --- a/app/src/main/java/com/miz/service/TvShowsLibraryUpdate.java +++ b/app/src/main/java/com/miz/service/TvShowsLibraryUpdate.java @@ -58,7 +58,6 @@ import java.util.List; import static com.miz.functions.PreferenceKeys.CLEAR_LIBRARY_TVSHOWS; -import static com.miz.functions.PreferenceKeys.ENABLE_SUBFOLDER_SEARCH; import static com.miz.functions.PreferenceKeys.REMOVE_UNAVAILABLE_FILES_TVSHOWS; import static com.miz.functions.PreferenceKeys.SYNC_WITH_TRAKT; @@ -70,7 +69,7 @@ public class TvShowsLibraryUpdate extends IntentService implements TvShowLibrary private ArrayList> mTvShowFileSources; private ArrayList mFiles; private HashSet mUniqueShowIds = new HashSet(); - private boolean mClearLibrary, mSearchSubfolders, mClearUnavailable, mSyncLibraries, mStopUpdate; + private boolean mClearLibrary, mClearUnavailable, mSyncLibraries, mStopUpdate; private int mTotalFiles, mShowCount, mEpisodeCount; private SharedPreferences mSettings; private Editor mEditor; @@ -132,7 +131,7 @@ protected void onHandleIntent(Intent intent) { log("setupTvShowsFileSources()"); // Add the different file sources to the TvShowFileSource ArrayList - setupTvShowsFileSources(mSearchSubfolders, mClearLibrary); + setupTvShowsFileSources(mClearLibrary); if (mStopUpdate) return; @@ -217,19 +216,19 @@ private void loadFileSources() { } } - private void setupTvShowsFileSources(boolean mSearchSubfolders, boolean mClearLibrary) { + private void setupTvShowsFileSources(boolean mClearLibrary) { for (FileSource fileSource : mFileSources) { if (mStopUpdate) return; switch (fileSource.getFileSourceType()) { case FileSource.FILE: - mTvShowFileSources.add(new FileTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mTvShowFileSources.add(new FileTvShow(getApplicationContext(), fileSource, mClearLibrary)); break; case FileSource.SMB: - mTvShowFileSources.add(new SmbTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mTvShowFileSources.add(new SmbTvShow(getApplicationContext(), fileSource, mClearLibrary)); break; case FileSource.UPNP: - mTvShowFileSources.add(new UpnpTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary)); + mTvShowFileSources.add(new UpnpTvShow(getApplicationContext(), fileSource, mClearLibrary)); break; } } @@ -326,7 +325,6 @@ private void setup() { mSettings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); mClearLibrary = mSettings.getBoolean(CLEAR_LIBRARY_TVSHOWS, false); - mSearchSubfolders = mSettings.getBoolean(ENABLE_SUBFOLDER_SEARCH, true); mClearUnavailable = mSettings.getBoolean(REMOVE_UNAVAILABLE_FILES_TVSHOWS, false); mSyncLibraries = mSettings.getBoolean(SYNC_WITH_TRAKT, true); } @@ -359,7 +357,6 @@ private void clear() { // Booleans mClearLibrary = false; - mSearchSubfolders = true; mClearUnavailable = false; mSyncLibraries = true; mStopUpdate = false; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 89f80926..b60efe52 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -148,8 +148,6 @@ Mizuu - Movies Mizuu - TV shows Trailer - Enable sub-folder search - Include sub-folders in video file searches. IP address or host name No IP address or host name! Username diff --git a/app/src/main/res/xml/identification_search_prefs.xml b/app/src/main/res/xml/identification_search_prefs.xml index 1d18cc71..47bb9de8 100644 --- a/app/src/main/res/xml/identification_search_prefs.xml +++ b/app/src/main/res/xml/identification_search_prefs.xml @@ -8,13 +8,6 @@ android:title="@string/set_pref_language_title" /> - -