Add Filler category
Implement Tangential jokes/filler SponsorBlock category.
This commit is contained in:
parent
7857ae29c9
commit
3339910d7f
8 changed files with 57 additions and 0 deletions
|
@ -322,6 +322,10 @@ public class LocalPlayer implements EventListener {
|
|||
toastText = context
|
||||
.getString(R.string.sponsor_block_skip_non_music_toast);
|
||||
break;
|
||||
case "filler":
|
||||
toastText = context
|
||||
.getString(R.string.sponsor_block_skip_filler_toast);
|
||||
break;
|
||||
}
|
||||
|
||||
Toast.makeText(context, toastText, Toast.LENGTH_SHORT).show();
|
||||
|
|
|
@ -1823,6 +1823,10 @@ public final class Player implements
|
|||
toastText = context
|
||||
.getString(R.string.sponsor_block_skip_non_music_toast);
|
||||
break;
|
||||
case "filler":
|
||||
toastText = context
|
||||
.getString(R.string.sponsor_block_skip_filler_toast);
|
||||
break;
|
||||
}
|
||||
|
||||
Toast.makeText(context, toastText, Toast.LENGTH_SHORT).show();
|
||||
|
|
|
@ -58,6 +58,10 @@ public class SponsorBlockCategoriesSettingsFragment extends BasePreferenceFragme
|
|||
R.string.sponsor_block_category_non_music_color_key,
|
||||
R.color.non_music_segment);
|
||||
|
||||
setColorPreference(editor,
|
||||
R.string.sponsor_block_category_filler_color_key,
|
||||
R.color.filler_segment);
|
||||
|
||||
editor.apply();
|
||||
|
||||
Toast.makeText(p.getContext(), R.string.sponsor_block_reset_colors_toast,
|
||||
|
|
|
@ -71,6 +71,8 @@ public final class SponsorBlockUtils {
|
|||
.getString(R.string.sponsor_block_category_self_promo_key), false);
|
||||
final boolean includeMusicCategory = prefs.getBoolean(context
|
||||
.getString(R.string.sponsor_block_category_non_music_key), false);
|
||||
final boolean includeFillerCategory = prefs.getBoolean(context
|
||||
.getString(R.string.sponsor_block_category_filler_key), false);
|
||||
|
||||
final ArrayList<String> categoryParamList = new ArrayList<>();
|
||||
|
||||
|
@ -92,6 +94,9 @@ public final class SponsorBlockUtils {
|
|||
if (includeMusicCategory) {
|
||||
categoryParamList.add("music_offtopic");
|
||||
}
|
||||
if (includeFillerCategory) {
|
||||
categoryParamList.add("filler");
|
||||
}
|
||||
|
||||
if (categoryParamList.size() == 0) {
|
||||
return null;
|
||||
|
@ -268,6 +273,16 @@ public final class SponsorBlockUtils {
|
|||
: Color.parseColor(colorStr);
|
||||
}
|
||||
break;
|
||||
case "filler":
|
||||
key = context.getString(R.string.sponsor_block_category_filler_key);
|
||||
if (prefs.getBoolean(key, false)) {
|
||||
key = context.getString(R.string.sponsor_block_category_filler_color_key);
|
||||
colorStr = prefs.getString(key, null);
|
||||
return colorStr == null
|
||||
? context.getResources().getColor(R.color.filler_segment)
|
||||
: Color.parseColor(colorStr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -87,4 +87,5 @@
|
|||
<color name="interaction_segment">#cc00ff</color>
|
||||
<color name="self_promo_segment">#ffff00</color>
|
||||
<color name="non_music_segment">#ff9900</color>
|
||||
<color name="filler_segment">#7300ff</color>
|
||||
</resources>
|
||||
|
|
|
@ -411,6 +411,8 @@
|
|||
<string name="sponsor_block_category_self_promo_color_key" translatable="false">sponsor_block_category_self_promo_color</string>
|
||||
<string name="sponsor_block_category_non_music_key" translatable="false">sponsor_block_category_music</string>
|
||||
<string name="sponsor_block_category_non_music_color_key" translatable="false">sponsor_block_category_music_color</string>
|
||||
<string name="sponsor_block_category_filler_key" translatable="false">sponsor_block_category_filler</string>
|
||||
<string name="sponsor_block_category_filler_color_key" translatable="false">sponsor_block_category_filler_color</string>
|
||||
<string name="sponsor_block_whitelist_key" translatable="false">sponsor_block_whitelist</string>
|
||||
<string name="sponsor_block_clear_whitelist_key" translatable="false">sponsor_block_clear_whitelist</string>
|
||||
|
||||
|
|
|
@ -160,6 +160,8 @@
|
|||
<string name="settings_category_sponsor_block_category_self_promo_summary">Similar to "sponsor" except for unpaid or self promotion. This includes sections about merchandise, donations, or information about who they collaborated with.</string>
|
||||
<string name="settings_category_sponsor_block_category_non_music_title">Music: Non-Music Section</string>
|
||||
<string name="settings_category_sponsor_block_category_non_music_summary">Only for use in music videos. This includes introductions or outros in music videos.</string>
|
||||
<string name="settings_category_sponsor_block_category_filler_title">Filler Tangent/Jokes</string>
|
||||
<string name="settings_category_sponsor_block_category_filler_summary">This is for tangential scenes added only for filler or humor that are not required to understand the main content of the video.</string>
|
||||
<string name="background_player_playing_toast">Playing in background</string>
|
||||
<string name="popup_playing_toast">Playing in popup mode</string>
|
||||
<string name="content">Content</string>
|
||||
|
@ -759,6 +761,7 @@
|
|||
<string name="sponsor_block_skip_interaction_toast">Skipped interaction reminder</string>
|
||||
<string name="sponsor_block_skip_self_promo_toast">Skipped unpaid/self promo</string>
|
||||
<string name="sponsor_block_skip_non_music_toast">Skipped non-music</string>
|
||||
<string name="sponsor_block_skip_filler_toast">Skipped filler</string>
|
||||
<string name="sponsor_block_toggle_skipping">Toggle skipping sponsors</string>
|
||||
<string name="sponsor_block_clear_whitelist_title">Clear Whitelist</string>
|
||||
<string name="sponsor_block_clear_whitelist_summary">Clear the list of uploaders SponsorBlock will ignore.</string>
|
||||
|
|
|
@ -148,6 +148,30 @@
|
|||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/settings_category_header_layout"
|
||||
android:title="@string/settings_category_sponsor_block_category_filler_title">
|
||||
|
||||
<Preference
|
||||
app:iconSpaceReserved="false"
|
||||
android:summary="@string/settings_category_sponsor_block_category_filler_summary"
|
||||
android:selectable="false"/>
|
||||
|
||||
<SwitchPreference
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/sponsor_block_category_filler_key"
|
||||
android:title="@string/settings_category_sponsor_block_category_enable_title"/>
|
||||
|
||||
<org.schabi.newpipe.settings.custom.EditColorPreference
|
||||
app:iconSpaceReserved="false"
|
||||
android:dependency="@string/sponsor_block_category_filler_key"
|
||||
android:defaultValue="@color/filler_segment"
|
||||
android:key="@string/sponsor_block_category_filler_color_key"
|
||||
android:title="@string/settings_category_sponsor_block_category_color"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/settings_category_header_layout">
|
||||
|
||||
|
|
Loading…
Reference in a new issue