freetube.channels
This commit is contained in:
parent
45df475195
commit
2a01ef0066
1 changed files with 29 additions and 0 deletions
29
rwx/sw/freetube/channels.py
Normal file
29
rwx/sw/freetube/channels.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"""FreeTube channels."""
|
||||||
|
|
||||||
|
from rwx import Class
|
||||||
|
|
||||||
|
|
||||||
|
class Channel(Class):
|
||||||
|
"""FreeTube channel."""
|
||||||
|
|
||||||
|
def __init__(self, uid: str, name: str) -> None:
|
||||||
|
"""Set uid & name.
|
||||||
|
|
||||||
|
:param uid: unique identifier
|
||||||
|
:type uid: str
|
||||||
|
:param name: label
|
||||||
|
:type name: str
|
||||||
|
"""
|
||||||
|
self.id = uid
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
def to_db(self) -> str:
|
||||||
|
"""Return identifier as db.
|
||||||
|
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return f"""\
|
||||||
|
{{\
|
||||||
|
"id":"{self.id}"\
|
||||||
|
}}\
|
||||||
|
"""
|
Loading…
Reference in a new issue