Skip to content

Commit

Permalink
Remove "Ignore previously deleted files" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
MizzleDK committed Jan 31, 2016
1 parent f8ce4e6 commit 6e7f5c5
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 530 deletions.
14 changes: 0 additions & 14 deletions app/src/main/java/com/miz/db/DbAdapterMovieMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ public Cursor getAllFilepaths(boolean includeRemoved) {
return mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, includeRemoved ? null : "NOT(" + KEY_IGNORED + " = '1')", null, null, null, null);
}

public Cursor getAllIgnoredFilepaths() {
return mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, KEY_IGNORED + " = '1'", null, null, null, null);
}

public Cursor getAllUnidentifiedFilepaths() {
return mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, "NOT(" + KEY_IGNORED + " = '1') AND " + KEY_TMDB_ID + "='" + DbAdapterMovies.UNIDENTIFIED_ID + "'", null, null, null, null);
}
Expand Down Expand Up @@ -136,10 +132,6 @@ public boolean filepathExists(String tmdbId, String filepath) {
return result;
}

public boolean deleteIgnoredFilepath(String filepath) {
return mDatabase.delete(DATABASE_TABLE, KEY_FILEPATH + " = ?", new String[]{filepath}) > 0;
}

public boolean deleteMovie(String tmdbId) {
return mDatabase.delete(DATABASE_TABLE, KEY_TMDB_ID + " = ?", new String[]{tmdbId}) > 0;
}
Expand All @@ -148,12 +140,6 @@ public boolean deleteAllMovies() {
return mDatabase.delete(DATABASE_TABLE, null, null) > 0;
}

public boolean ignoreMovie(String tmdbId) {
ContentValues ignore = new ContentValues();
ignore.put(KEY_IGNORED, 1);
return mDatabase.update(DATABASE_TABLE, ignore, KEY_TMDB_ID + " = ?", new String[]{tmdbId}) > 0;
}

public boolean hasMultipleFilepaths(String tmdbId) {
Cursor cursor = mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, KEY_TMDB_ID + " = ?", new String[]{tmdbId}, null, null, null);
boolean result = false;
Expand Down
22 changes: 0 additions & 22 deletions app/src/main/java/com/miz/db/DbAdapterTvShowEpisodeMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.content.Context;
import android.database.Cursor;

import com.miz.functions.Filepath;
import com.miz.functions.MizLib;

import java.util.ArrayList;
Expand Down Expand Up @@ -153,24 +152,11 @@ public Cursor getAllFilepaths(String showId) {
return mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, KEY_SHOW_ID + " = ?", new String[]{showId}, null, null, null);
}

public Cursor getAllIgnoredFilepaths() {
return mDatabase.query(DATABASE_TABLE, ALL_COLUMNS, KEY_IGNORED + " = '1'", null, null, null, null);
}

public boolean deleteFilepath(String filepath) {
String[] selectionArgs = new String[]{filepath};
return mDatabase.delete(DATABASE_TABLE, KEY_FILEPATH + " = ?", selectionArgs) > 0;
}

public boolean ignoreFilepath(String filepath) {
String[] selectionArgs = new String[]{filepath};

ContentValues values = new ContentValues();
values.put(KEY_IGNORED, 1); // Set the ignored value to 1 (true)

return mDatabase.update(DATABASE_TABLE, values, KEY_FILEPATH + " = ?", selectionArgs) > 0;
}

public boolean deleteAllFilepaths(String showId) {
return mDatabase.delete(DATABASE_TABLE, KEY_SHOW_ID + " = ?", new String[]{showId}) > 0;
}
Expand Down Expand Up @@ -206,14 +192,6 @@ public boolean removeSeason(String showId, int season) {
new String[]{showId, MizLib.addIndexZero(season)}) > 0;
}

public boolean ignoreSeason(String showId, int season) {
ContentValues values = new ContentValues();
values.put(KEY_IGNORED, 1); // Set the ignored value to 1 (true)

return mDatabase.update(DATABASE_TABLE, values, KEY_SHOW_ID + " = ? AND " + KEY_SEASON + " = ?",
new String[]{showId, MizLib.addIndexZero(season)}) > 0;
}

/**
* Used for unit testing
* @return
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 IGNORED_FILES_ENABLED = "prefsIgnoredFilesEnabled";
public static final String IGNORE_VIDEO_FILE_TYPE = "prefsIgnoreFileType";
public static final String IGNORED_TITLE_PREFIXES = "prefsIgnorePrefixesInTitles";
public static final String REMOVE_MOVIES_FROM_WATCHLIST = "prefsRemoveMoviesFromWatchlist";
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6e7f5c5

Please sign in to comment.