Skip to content

Commit

Permalink
fix: avoid sponsor block for first few seconds to not break the stream
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Aug 4, 2023
1 parent 1431472 commit d8cf2ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>

audioPlayer.positionStream.listen((position) async {
// skipping in very first second breaks stream
if (position < const Duration(seconds: 3)) return;
if ((preferences.youtubeApiType == YoutubeApiType.piped &&
preferences.searchMode == SearchMode.youtubeMusic) ||
!preferences.skipNonMusic) return;
Expand All @@ -165,7 +164,7 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
}

final (source: _, :segments) = currentSegments!;
if (segments.isEmpty) return;
if (segments.isEmpty || position < const Duration(seconds: 3)) return;

for (final segment in segments) {
if ((position.inSeconds >= segment.start &&
Expand Down

0 comments on commit d8cf2ae

Please sign in to comment.