[format] Blacken some stuff
This commit is contained in:
@ -63,7 +63,9 @@ class KoReaderImportSerializer(serializers.HyperlinkedModelSerializer):
|
|||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|
||||||
|
|
||||||
class AudioScrobblerTSVImportSerializer(serializers.HyperlinkedModelSerializer):
|
class AudioScrobblerTSVImportSerializer(
|
||||||
|
serializers.HyperlinkedModelSerializer
|
||||||
|
):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = AudioScrobblerTSVImport
|
model = AudioScrobblerTSVImport
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|||||||
@ -39,9 +39,9 @@ class Domain(TimeStampedModel):
|
|||||||
def scrobbles_for_user(self, user_id):
|
def scrobbles_for_user(self, user_id):
|
||||||
from scrobbles.models import Scrobble
|
from scrobbles.models import Scrobble
|
||||||
|
|
||||||
return Scrobble.objects.filter(web_page__domain=self, user_id=user_id).order_by(
|
return Scrobble.objects.filter(
|
||||||
"-timestamp"
|
web_page__domain=self, user_id=user_id
|
||||||
)
|
).order_by("-timestamp")
|
||||||
|
|
||||||
|
|
||||||
class WebPage(ScrobblableMixin):
|
class WebPage(ScrobblableMixin):
|
||||||
@ -136,7 +136,9 @@ class WebPage(ScrobblableMixin):
|
|||||||
|
|
||||||
def scrobbles(self, user):
|
def scrobbles(self, user):
|
||||||
Scrobble = apps.get_model("scrobbles", "Scrobble")
|
Scrobble = apps.get_model("scrobbles", "Scrobble")
|
||||||
return Scrobble.objects.filter(user=user, web_page=self).order_by("-timestamp")
|
return Scrobble.objects.filter(user=user, web_page=self).order_by(
|
||||||
|
"-timestamp"
|
||||||
|
)
|
||||||
|
|
||||||
def clean_title(self, title: str, save=True):
|
def clean_title(self, title: str, save=True):
|
||||||
if len(title.split("|")) > 1:
|
if len(title.split("|")) > 1:
|
||||||
@ -211,7 +213,9 @@ class WebPage(ScrobblableMixin):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
logger.info("Website already exists in archive", extra={"url": self.url})
|
logger.info(
|
||||||
|
"Website already exists in archive", extra={"url": self.url}
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Failed to push URL to archivebox (Response {response.status_code})"
|
f"Failed to push URL to archivebox (Response {response.status_code})"
|
||||||
|
|||||||
Reference in New Issue
Block a user