Skip to content

Commit

Permalink
Remove "Disable Ethernet / Wi-Fi check" preference
Browse files Browse the repository at this point in the history
  • Loading branch information
MizzleDK committed Jan 31, 2016
1 parent a264057 commit 6e969be
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class MovieFileSource<T> extends AbstractFileSource<T> {

protected List<DbMovie> mDbMovies = new ArrayList<DbMovie>();

public MovieFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
public MovieFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
mContext = context;
mFileSource = fileSource;
mSubFolderSearch = subFolderSearch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class TvShowFileSource<T> extends AbstractFileSource<T> {

protected List<DbEpisode> mDbEpisode = new ArrayList<DbEpisode>();

public TvShowFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
public TvShowFileSource(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
mContext = context;
mFileSource = fileSource;
mSubFolderSearch = subFolderSearch;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/FileMovie.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class FileMovie extends MovieFileSource<File> {
private HashMap<String, String> existingMovies = new HashMap<String, String>();
private File tempFile;

public FileMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public FileMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/FileTvShow.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class FileTvShow extends TvShowFileSource<File> {
private HashMap<String, String> existingEpisodes = new HashMap<String, String>();
private File tempFile;

public FileTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public FileTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/SmbMovie.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public class SmbMovie extends MovieFileSource<SmbFile> {
private HashMap<String, String> existingMovies = new HashMap<String, String>();
private SmbFile tempSmbFile;

public SmbMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public SmbMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/SmbTvShow.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class SmbTvShow extends TvShowFileSource<SmbFile> {
private HashMap<String, String> existingEpisodes = new HashMap<String, String>();
private SmbFile tempSmbFile;

public SmbTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public SmbTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/UpnpMovie.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public class UpnpMovie extends MovieFileSource<String> {
private CountDownLatch mLatch = new CountDownLatch(1);
private AndroidUpnpService mUpnpService;

public UpnpMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public UpnpMovie(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/miz/filesources/UpnpTvShow.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public class UpnpTvShow extends TvShowFileSource<String> {
private CountDownLatch mLatch = new CountDownLatch(1);
private AndroidUpnpService mUpnpService;

public UpnpTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary, boolean disableEthernetWiFiCheck) {
super(context, fileSource, subFolderSearch, clearLibrary, disableEthernetWiFiCheck);
public UpnpTvShow(Context context, FileSource fileSource, boolean subFolderSearch, boolean clearLibrary) {
super(context, fileSource, subFolderSearch, clearLibrary);
}

@Override
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/com/miz/functions/MizLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;

import static com.miz.functions.PreferenceKeys.DISABLE_ETHERNET_WIFI_CHECK;
import static com.miz.functions.PreferenceKeys.IGNORE_FILE_SIZE;
import static com.miz.functions.PreferenceKeys.INCLUDE_ADULT_CONTENT;
import static com.miz.functions.PreferenceKeys.SCHEDULED_UPDATES_MOVIE;
Expand Down Expand Up @@ -313,11 +312,6 @@ public static boolean isOnline(Context c) {
*/
public static boolean isWifiConnected(Context c) {
if (c!= null) {
boolean disableEthernetWiFiCheck = PreferenceManager.getDefaultSharedPreferences(c).getBoolean(DISABLE_ETHERNET_WIFI_CHECK, false);

if (disableEthernetWiFiCheck)
return isOnline(c);

ConnectivityManager connManager = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] connections = connManager.getAllNetworkInfo();
int count = connections.length;
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/miz/functions/PreferenceKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ private PreferenceKeys() {} // No instantiation
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 DISABLE_ETHERNET_WIFI_CHECK = "prefsDisableEthernetWiFiCheck";
public static final String IGNORED_FILES_ENABLED = "prefsIgnoredFilesEnabled";
public static final String IGNORE_VIDEO_FILE_TYPE = "prefsIgnoreFileType";
public static final String IGNORED_TITLE_PREFIXES = "prefsIgnorePrefixesInTitles";
Expand Down
15 changes: 6 additions & 9 deletions app/src/main/java/com/miz/service/MovieLibraryUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import java.util.List;

import static com.miz.functions.PreferenceKeys.CLEAR_LIBRARY_MOVIES;
import static com.miz.functions.PreferenceKeys.DISABLE_ETHERNET_WIFI_CHECK;
import static com.miz.functions.PreferenceKeys.ENABLE_SUBFOLDER_SEARCH;
import static com.miz.functions.PreferenceKeys.IGNORED_FILES_ENABLED;
import static com.miz.functions.PreferenceKeys.REMOVE_UNAVAILABLE_FILES_MOVIES;
Expand All @@ -70,7 +69,7 @@ public class MovieLibraryUpdate extends IntentService implements MovieLibraryUpd
private ArrayList<FileSource> mFileSources;
private ArrayList<MovieFileSource<?>> mMovieFileSources;
private ArrayList<MovieStructure> mMovieQueue = new ArrayList<MovieStructure>();
private boolean mIgnoreRemovedFiles, mClearLibrary, mSearchSubfolders, mClearUnavailable, mDisableEthernetWiFiCheck, mSyncLibraries, mStopUpdate;
private boolean mIgnoreRemovedFiles, mClearLibrary, mSearchSubfolders, mClearUnavailable, mSyncLibraries, mStopUpdate;
private int mTotalFiles, mCount;
private SharedPreferences mSettings;
private Editor mEditor;
Expand Down Expand Up @@ -132,7 +131,7 @@ protected void onHandleIntent(Intent intent) {
log("setupMovieFileSources()");

// Add the different file sources to the MovieFileSource ArrayList
setupMovieFileSources(mIgnoreRemovedFiles, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck);
setupMovieFileSources(mIgnoreRemovedFiles, mSearchSubfolders, mClearLibrary);

if (mStopUpdate)
return;
Expand Down Expand Up @@ -225,19 +224,19 @@ private void loadFileSources() {
}
}

private void setupMovieFileSources(boolean mIgnoreRemovedFiles, boolean mSearchSubfolders, boolean mClearLibrary, boolean mDisableEthernetWiFiCheck) {
private void setupMovieFileSources(boolean mIgnoreRemovedFiles, boolean mSearchSubfolders, boolean mClearLibrary) {
for (FileSource fileSource : mFileSources) {
if (mStopUpdate)
return;
switch (fileSource.getFileSourceType()) {
case FileSource.FILE:
mMovieFileSources.add(new FileMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mMovieFileSources.add(new FileMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
case FileSource.SMB:
mMovieFileSources.add(new SmbMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mMovieFileSources.add(new SmbMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
case FileSource.UPNP:
mMovieFileSources.add(new UpnpMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mMovieFileSources.add(new UpnpMovie(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
}
}
Expand Down Expand Up @@ -319,7 +318,6 @@ private void setup() {
mClearLibrary = mSettings.getBoolean(CLEAR_LIBRARY_MOVIES, false);
mSearchSubfolders = mSettings.getBoolean(ENABLE_SUBFOLDER_SEARCH, true);
mClearUnavailable = mSettings.getBoolean(REMOVE_UNAVAILABLE_FILES_MOVIES, false);
mDisableEthernetWiFiCheck = mSettings.getBoolean(DISABLE_ETHERNET_WIFI_CHECK, false);
mIgnoreRemovedFiles = mSettings.getBoolean(IGNORED_FILES_ENABLED, false);
mSyncLibraries = mSettings.getBoolean(SYNC_WITH_TRAKT, true);
}
Expand Down Expand Up @@ -350,7 +348,6 @@ private void clear() {
mClearLibrary = false;
mSearchSubfolders = true;
mClearUnavailable = false;
mDisableEthernetWiFiCheck = false;
mSyncLibraries = true;
mStopUpdate = false;

Expand Down
17 changes: 7 additions & 10 deletions app/src/main/java/com/miz/service/TvShowsLibraryUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
import java.util.HashSet;
import java.util.List;

import static com.miz.functions.PreferenceKeys.CLEAR_LIBRARY_TVSHOWS;
import static com.miz.functions.PreferenceKeys.DISABLE_ETHERNET_WIFI_CHECK;
import static com.miz.functions.PreferenceKeys.CLEAR_LIBRARY_TVSHOWS;;
import static com.miz.functions.PreferenceKeys.ENABLE_SUBFOLDER_SEARCH;
import static com.miz.functions.PreferenceKeys.IGNORED_FILES_ENABLED;
import static com.miz.functions.PreferenceKeys.REMOVE_UNAVAILABLE_FILES_TVSHOWS;
Expand All @@ -72,7 +71,7 @@ public class TvShowsLibraryUpdate extends IntentService implements TvShowLibrary
private ArrayList<TvShowFileSource<?>> mTvShowFileSources;
private ArrayList<ShowStructure> mFiles;
private HashSet<String> mUniqueShowIds = new HashSet<String>();
private boolean mIgnoreRemovedFiles, mClearLibrary, mSearchSubfolders, mClearUnavailable, mDisableEthernetWiFiCheck, mSyncLibraries, mStopUpdate;
private boolean mIgnoreRemovedFiles, mClearLibrary, mSearchSubfolders, mClearUnavailable, mSyncLibraries, mStopUpdate;
private int mTotalFiles, mShowCount, mEpisodeCount;
private SharedPreferences mSettings;
private Editor mEditor;
Expand Down Expand Up @@ -134,7 +133,7 @@ protected void onHandleIntent(Intent intent) {
log("setupTvShowsFileSources()");

// Add the different file sources to the TvShowFileSource ArrayList
setupTvShowsFileSources(mIgnoreRemovedFiles, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck);
setupTvShowsFileSources(mIgnoreRemovedFiles, mSearchSubfolders, mClearLibrary);

if (mStopUpdate)
return;
Expand Down Expand Up @@ -219,19 +218,19 @@ private void loadFileSources() {
}
}

private void setupTvShowsFileSources(boolean mIgnoreRemovedFiles, boolean mSearchSubfolders, boolean mClearLibrary, boolean mDisableEthernetWiFiCheck) {
private void setupTvShowsFileSources(boolean mIgnoreRemovedFiles, boolean mSearchSubfolders, boolean mClearLibrary) {
for (FileSource fileSource : mFileSources) {
if (mStopUpdate)
return;
switch (fileSource.getFileSourceType()) {
case FileSource.FILE:
mTvShowFileSources.add(new FileTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mTvShowFileSources.add(new FileTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
case FileSource.SMB:
mTvShowFileSources.add(new SmbTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mTvShowFileSources.add(new SmbTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
case FileSource.UPNP:
mTvShowFileSources.add(new UpnpTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary, mDisableEthernetWiFiCheck));
mTvShowFileSources.add(new UpnpTvShow(getApplicationContext(), fileSource, mSearchSubfolders, mClearLibrary));
break;
}
}
Expand Down Expand Up @@ -330,7 +329,6 @@ private void setup() {
mClearLibrary = mSettings.getBoolean(CLEAR_LIBRARY_TVSHOWS, false);
mSearchSubfolders = mSettings.getBoolean(ENABLE_SUBFOLDER_SEARCH, true);
mClearUnavailable = mSettings.getBoolean(REMOVE_UNAVAILABLE_FILES_TVSHOWS, false);
mDisableEthernetWiFiCheck = mSettings.getBoolean(DISABLE_ETHERNET_WIFI_CHECK, false);
mIgnoreRemovedFiles = mSettings.getBoolean(IGNORED_FILES_ENABLED, false);
mSyncLibraries = mSettings.getBoolean(SYNC_WITH_TRAKT, true);
}
Expand Down Expand Up @@ -366,7 +364,6 @@ private void clear() {
mClearLibrary = false;
mSearchSubfolders = true;
mClearUnavailable = false;
mDisableEthernetWiFiCheck = false;
mSyncLibraries = true;
mStopUpdate = false;

Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@
<string name="video">Video</string>
<string name="ignoreFileType">Ignore file format when playing videos</string>
<string name="ignoreFileTypeDescription">Disable MIME type specific video Intents and use a generic wildcard.</string>
<string name="disableEthernetWiFiCheck">Disable Ethernet / Wi-Fi check</string>
<string name="disableEthernetWiFiCheckDescription">Don\'t check for an Ethernet or Wi-Fi connection before connecting to a network share.</string>
<string name="lookingForNetworkSources">Looking for network sources…</string>
<string name="searching">Searching…</string>
<string name="scanForSources">Scan for network sources</string>
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/xml/advanced_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
android:key="prefsBufferSize"
android:summary="@string/bufferSizeDescription"
android:title="@string/bufferSize" />

<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_signal_wifi_statusbar_not_connected_white_24dp"
android:key="prefsDisableEthernetWiFiCheck"
android:summary="@string/disableEthernetWiFiCheckDescription"
android:title="@string/disableEthernetWiFiCheck" />
<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_file_download_white_24dp"
Expand Down

0 comments on commit 6e969be

Please sign in to comment.