add content filter to mediaccc

This commit is contained in:
Christian Schabesberger 2019-01-29 17:20:30 +01:00
parent d0a3125df4
commit 6edbfe2a6f
4 changed files with 11 additions and 3 deletions

View file

@ -57,7 +57,7 @@ dependencies {
exclude module: 'support-annotations'
})
implementation 'com.github.TeamNewPipe:NewPipeExtractor:d0efe8bd47'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:79b0a19d1af'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'

View file

@ -104,8 +104,13 @@ public class SearchFragment
// this three represet the current search query
@State
protected String searchString;
/**
* No content filter should add like contentfilter = all
* be aware of this when implementing an extractor.
*/
@State
protected String[] contentFilter;
protected String[] contentFilter = new String[0];
@State
protected String sortFilter;
@ -335,7 +340,7 @@ public class SearchFragment
|| (searchEditText != null && !TextUtils.isEmpty(searchEditText.getText()))) {
search(!TextUtils.isEmpty(searchString)
? searchString
: searchEditText.getText().toString(), new String[0], "");
: searchEditText.getText().toString(), this.contentFilter, "");
} else {
if (searchEditText != null) {
searchEditText.setText("");

View file

@ -40,6 +40,8 @@ public class ServiceHelper {
case "playlists": return c.getString(R.string.playlists);
case "tracks": return c.getString(R.string.tracks);
case "users": return c.getString(R.string.users);
case "conferences" : return c.getString(R.string.conferences);
case "events" : return c.getString(R.string.events);
default: return filter;
}
}

View file

@ -137,6 +137,7 @@
<string name="videos">Videos</string>
<string name="tracks">Tracks</string>
<string name="users">Users</string>
<string name="events">Events</string>
<string name="yes">Yes</string>
<string name="later">Later</string>
<string name="disabled">Disabled</string>