Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julien Veyssier
funkwhale
Commits
639882bd
Verified
Commit
639882bd
authored
Jun 09, 2018
by
Eliot Berriot
Browse files
See
#297
: removed unused variables
parent
2b1c4631
Changes
50
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/common/management/commands/script.py
View file @
639882bd
...
...
@@ -41,7 +41,6 @@ class Command(BaseCommand):
script
[
"entrypoint"
](
self
,
**
options
)
def
show_help
(
self
):
indentation
=
4
self
.
stdout
.
write
(
""
)
self
.
stdout
.
write
(
"Available scripts:"
)
self
.
stdout
.
write
(
"Launch with: python manage.py <script_name>"
)
...
...
api/funkwhale_api/common/serializers.py
View file @
639882bd
...
...
@@ -40,7 +40,6 @@ class ActionSerializer(serializers.Serializer):
return
value
def
validate_objects
(
self
,
value
):
qs
=
None
if
value
==
"all"
:
return
self
.
queryset
.
all
().
order_by
(
"id"
)
if
type
(
value
)
in
[
list
,
tuple
]:
...
...
api/funkwhale_api/downloader/downloader.py
View file @
639882bd
import
os
import
json
from
urllib.parse
import
quote_plus
import
youtube_dl
from
django.conf
import
settings
import
glob
def
download
(
...
...
api/funkwhale_api/federation/actors.py
View file @
639882bd
import
datetime
import
logging
import
uuid
import
xml
from
django.conf
import
settings
...
...
@@ -155,7 +154,6 @@ class SystemActor(object):
return
handler
(
data
,
actor
)
def
handle_follow
(
self
,
ac
,
sender
):
system_actor
=
self
.
get_actor_instance
()
serializer
=
serializers
.
FollowSerializer
(
data
=
ac
,
context
=
{
"follow_actor"
:
sender
}
)
...
...
@@ -325,7 +323,6 @@ class TestActor(SystemActor):
reply_url
=
"https://{}/activities/note/{}"
.
format
(
settings
.
FEDERATION_HOSTNAME
,
now
.
timestamp
()
)
reply_content
=
"{} Pong!"
.
format
(
sender
.
mention_username
)
reply_activity
=
{
"@context"
:
[
"https://www.w3.org/ns/activitystreams"
,
...
...
api/funkwhale_api/federation/serializers.py
View file @
639882bd
...
...
@@ -687,7 +687,7 @@ class AudioSerializer(serializers.Serializer):
def
validate_url
(
self
,
v
):
try
:
url
=
v
[
"href"
]
v
[
"href"
]
except
(
KeyError
,
TypeError
):
raise
serializers
.
ValidationError
(
"Missing href"
)
...
...
api/funkwhale_api/federation/signing.py
View file @
639882bd
...
...
@@ -47,7 +47,7 @@ def verify_django(django_request, public_key):
v
=
request
.
headers
[
h
]
if
v
:
request
.
headers
[
h
]
=
str
(
v
)
prepared_request
=
request
.
prepare
()
request
.
prepare
()
return
verify
(
request
,
public_key
)
...
...
api/funkwhale_api/federation/views.py
View file @
639882bd
...
...
@@ -249,7 +249,7 @@ class LibraryViewSet(
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
serializer
=
serializers
.
APILibraryCreateSerializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
library
=
serializer
.
save
()
serializer
.
save
()
return
response
.
Response
(
serializer
.
data
,
status
=
201
)
...
...
api/funkwhale_api/instance/nodeinfo.py
View file @
639882bd
...
...
@@ -12,7 +12,6 @@ memo = memoize.Memoizer(store, namespace="instance:stats")
def
get
():
share_stats
=
preferences
.
get
(
"instance__nodeinfo_stats_enabled"
)
private
=
preferences
.
get
(
"instance__nodeinfo_private"
)
data
=
{
"version"
:
"2.0"
,
"software"
:
{
"name"
:
"funkwhale"
,
"version"
:
funkwhale_api
.
__version__
},
...
...
api/funkwhale_api/music/lyrics.py
View file @
639882bd
import
urllib.request
import
html.parser
from
bs4
import
BeautifulSoup
...
...
api/funkwhale_api/music/management/commands/fix_track_files.py
View file @
639882bd
import
cacheops
import
os
from
django.db
import
transaction
from
django.db.models
import
Q
...
...
api/funkwhale_api/music/migrations/0011_rename_files.py
View file @
639882bd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
os
from
django.db
import
migrations
,
models
from
funkwhale_api.common.utils
import
rename_file
...
...
api/funkwhale_api/music/migrations/0015_bind_track_file_to_import_job.py
View file @
639882bd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
os
from
django.db
import
migrations
,
models
from
funkwhale_api.common.utils
import
rename_file
...
...
api/funkwhale_api/music/migrations/0019_populate_mimetypes.py
View file @
639882bd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
os
from
django.db
import
migrations
,
models
from
funkwhale_api.music.utils
import
guess_mimetype
...
...
api/funkwhale_api/music/migrations/0021_populate_batch_status.py
View file @
639882bd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
os
from
django.db
import
migrations
,
models
...
...
api/funkwhale_api/music/migrations/0024_populate_uuid.py
View file @
639882bd
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
os
import
uuid
from
django.db
import
migrations
,
models
...
...
api/funkwhale_api/music/models.py
View file @
639882bd
import
os
import
io
import
arrow
import
datetime
import
tempfile
...
...
api/funkwhale_api/music/views.py
View file @
639882bd
import
ffmpeg
import
os
import
json
import
logging
import
subprocess
import
unicodedata
import
urllib
...
...
api/funkwhale_api/providers/audiofile/management/commands/import_files.py
View file @
639882bd
...
...
@@ -178,7 +178,6 @@ class Command(BaseCommand):
async
=
options
[
"async"
]
import_handler
=
tasks
.
import_job_run
.
delay
if
async
else
tasks
.
import_job_run
batch
=
user
.
imports
.
create
(
source
=
"shell"
)
total
=
len
(
paths
)
errors
=
[]
for
i
,
path
in
list
(
enumerate
(
paths
)):
try
:
...
...
api/funkwhale_api/providers/audiofile/tasks.py
View file @
639882bd
import
acoustid
import
os
import
datetime
from
django.core.files
import
File
from
django.db
import
transaction
...
...
api/funkwhale_api/radios/radios.py
View file @
639882bd
...
...
@@ -147,7 +147,7 @@ class TagRadio(RelatedObjectRadio):
def
get_queryset
(
self
,
**
kwargs
):
qs
=
super
().
get_queryset
(
**
kwargs
)
return
Track
.
object
s
.
filter
(
tags__in
=
[
self
.
session
.
related_object
])
return
q
s
.
filter
(
tags__in
=
[
self
.
session
.
related_object
])
@
registry
.
register
(
name
=
"artist"
)
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment