MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / decrement_stream_count

Function decrement_stream_count

apps/m3u/utils.py:47–57  ·  view source on GitHub ↗
(account)

Source from the content-addressed store, hash-verified

45 account.save(update_fields=['active_streams'])
46
47def decrement_stream_count(account):
48 with lock:
49 current_usage = active_streams_map.get(account.id, 0)
50 if current_usage > 0:
51 current_usage -= 1
52 if current_usage == 0:
53 del active_streams_map[account.id]
54 else:
55 active_streams_map[account.id] = current_usage
56 account.active_streams = current_usage
57 account.save(update_fields=['active_streams'])
58
59
60def calculate_tuner_count(minimum=1, unlimited_default=10):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected