Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Syng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Stahl
Syng
Commits
ca16dff2
Commit
ca16dff2
authored
Jul 9, 2024
by
Christoph Stahl
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some typing errors
parent
705169a1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
syng/entry.py
+5
-4
5 additions, 4 deletions
syng/entry.py
syng/sources/youtube.py
+11
-2
11 additions, 2 deletions
syng/sources/youtube.py
with
17 additions
and
6 deletions
pyproject.toml
+
1
−
0
View file @
ca16dff2
...
@@ -63,6 +63,7 @@ mypy_path = "typings"
...
@@ -63,6 +63,7 @@ mypy_path = "typings"
[[tool.mypy.overrides]]
[[tool.mypy.overrides]]
module
=
[
module
=
[
"yt_dlp"
,
"yt_dlp"
,
"yt_dlp.utils"
,
"pymediainfo"
,
"pymediainfo"
,
"minio"
,
"minio"
,
"qrcode"
,
"qrcode"
,
...
...
This diff is collapsed.
Click to expand it.
syng/entry.py
+
5
−
4
View file @
ca16dff2
"""
Module for the entry of the queue.
"""
"""
Module for the entry of the queue.
"""
from
__future__
import
annotations
from
__future__
import
annotations
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
...
@@ -22,9 +23,9 @@ class Entry:
...
@@ -22,9 +23,9 @@ class Entry:
:param duration: The duration of the song in seconds.
:param duration: The duration of the song in seconds.
:type duration: int
:type duration: int
:param title: The title of the song.
:param title: The title of the song.
:type title: str
:type title:
Optional[
str
]
:param artist: The name of the original artist.
:param artist: The name of the original artist.
:type artist: str
:type artist:
Optional[
str
]
:param album: The name of the album or compilation, this particular
:param album: The name of the album or compilation, this particular
version is from.
version is from.
:type album: str
:type album: str
...
@@ -51,8 +52,8 @@ class Entry:
...
@@ -51,8 +52,8 @@ class Entry:
ident
:
str
ident
:
str
source
:
str
source
:
str
duration
:
int
duration
:
int
title
:
str
title
:
Optional
[
str
]
artist
:
str
artist
:
Optional
[
str
]
album
:
str
album
:
str
performer
:
str
performer
:
str
failed
:
bool
=
False
failed
:
bool
=
False
...
...
This diff is collapsed.
Click to expand it.
syng/sources/youtube.py
+
11
−
2
View file @
ca16dff2
...
@@ -33,6 +33,9 @@ class YouTube:
...
@@ -33,6 +33,9 @@ class YouTube:
)
# TODO: this may grow fast... but atm it fixed youtubes anti bot measures
)
# TODO: this may grow fast... but atm it fixed youtubes anti bot measures
def
__init__
(
self
,
url
:
Optional
[
str
]
=
None
):
def
__init__
(
self
,
url
:
Optional
[
str
]
=
None
):
self
.
_title
:
Optional
[
str
]
self
.
_author
:
Optional
[
str
]
if
url
is
not
None
:
if
url
is
not
None
:
if
url
in
YouTube
.
__cache__
:
if
url
in
YouTube
.
__cache__
:
self
.
_infos
=
YouTube
.
__cache__
[
url
]
self
.
_infos
=
YouTube
.
__cache__
[
url
]
...
@@ -62,11 +65,17 @@ class YouTube:
...
@@ -62,11 +65,17 @@ class YouTube:
@property
@property
def
title
(
self
)
->
str
:
def
title
(
self
)
->
str
:
return
""
if
self
.
_title
is
None
else
self
.
_title
if
self
.
_title
is
None
:
return
""
else
:
return
self
.
_title
@property
@property
def
author
(
self
)
->
str
:
def
author
(
self
)
->
str
:
return
""
if
self
.
_author
is
None
else
self
.
_author
if
self
.
_author
is
None
:
return
""
else
:
return
self
.
_author
@classmethod
@classmethod
def
from_result
(
cls
,
search_result
:
dict
[
str
,
Any
])
->
YouTube
:
def
from_result
(
cls
,
search_result
:
dict
[
str
,
Any
])
->
YouTube
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment