diff --git a/tubesync/sync/models/source.py b/tubesync/sync/models/source.py index a739936a..04fe84d4 100644 --- a/tubesync/sync/models/source.py +++ b/tubesync/sync/models/source.py @@ -544,10 +544,15 @@ class Source(db.models.Model): if not self.is_playlist: if self.index_streams: streams = self.get_index('streams') - # do not allow streams to consume all of the queue - if entries.maxlen and entries.maxlen <= len(streams): - streams = streams[-1 * ( entries.maxlen // 2 ) :] - entries.extend(reversed(streams)) + if entries.maxlen is None or 0 == len(entries): + entries.extend(streams) + else: + # share the queue between streams and videos + allowed_streams = max( + entries.maxlen // 2, + entries.maxlen - len(entries), + ) + entries.extend(streams[-1 * allowed_streams :]) return entries