21
21
22
22
23
23
class Stream :
24
+ __slots__ = ("channel" , "broadcast_id" , "viewers" , "drops_enabled" , "game" , "title" )
25
+
24
26
def __init__ (
25
27
self ,
26
28
channel : Channel ,
@@ -76,7 +78,7 @@ def __init__(
76
78
id : SupportsInt ,
77
79
login : str ,
78
80
display_name : str | None = None ,
79
- priority : bool = False ,
81
+ acl_based : bool = False ,
80
82
):
81
83
self ._twitch : Twitch = twitch
82
84
self ._gui_channels : ChannelList = twitch .gui .channels
@@ -87,11 +89,11 @@ def __init__(
87
89
self .points : int | None = None
88
90
self ._stream : Stream | None = None
89
91
self ._pending_stream_up : asyncio .Task [Any ] | None = None
90
- # Priority channels are:
92
+ # ACL-based channels are:
91
93
# • considered first when switching channels
92
- # • if we're watching a non-priority channel, a priority channel going up triggers a switch
94
+ # • if we're watching a non-based channel, a based channel going up triggers a switch
93
95
# • not cleaned up unless they're streaming a game we haven't selected
94
- self .priority : bool = priority
96
+ self .acl_based : bool = acl_based
95
97
96
98
@classmethod
97
99
def from_acl (cls , twitch : Twitch , data : JsonType ) -> Channel :
@@ -100,7 +102,7 @@ def from_acl(cls, twitch: Twitch, data: JsonType) -> Channel:
100
102
id = data ["id" ],
101
103
login = data ["name" ],
102
104
display_name = data .get ("displayName" ),
103
- priority = True ,
105
+ acl_based = True ,
104
106
)
105
107
106
108
@classmethod
@@ -114,9 +116,9 @@ def from_directory(cls, twitch: Twitch, data: JsonType) -> Channel:
114
116
115
117
@classmethod
116
118
async def from_name (
117
- cls , twitch : Twitch , channel_login : str , * , priority : bool = False
119
+ cls , twitch : Twitch , channel_login : str , * , acl_based : bool = False
118
120
) -> Channel :
119
- self = cls (twitch , id = 0 , login = channel_login , priority = priority )
121
+ self = cls (twitch , id = 0 , login = channel_login , acl_based = acl_based )
120
122
# id and display name to be filled/overwritten by get_stream
121
123
stream = await self .get_stream ()
122
124
if stream is not None :
@@ -180,7 +182,7 @@ def pending_online(self) -> bool:
180
182
181
183
@property
182
184
def game (self ) -> Game | None :
183
- if self ._stream is not None and self . _stream . game is not None :
185
+ if self ._stream is not None :
184
186
return self ._stream .game
185
187
return None
186
188
0 commit comments