Browse Source

Clean up imports

Colin Powell 2 years ago
parent
commit
3d7528030a

+ 4 - 5
tests/scrobbles_tests/test_views.py

@@ -1,11 +1,10 @@
 import json
-import pytest
 
+import pytest
 from django.urls import reverse
-
-from vrobbler.apps.scrobbles.models import Scrobble
-from vrobbler.apps.music.models import Track
-from vrobbler.apps.podcasts.models import Episode
+from music.models import Track
+from podcasts.models import Episode
+from scrobbles.models import Scrobble
 
 
 @pytest.mark.django_db

+ 1 - 1
tests/videos_tests/test_imdb.py

@@ -1,6 +1,6 @@
 import pytest
 
-from vrobbler.apps.videos.imdb import lookup_video_from_imdb
+from videos.imdb import lookup_video_from_imdb
 
 
 @pytest.mark.skip(reason="Need to sort out third party API testing")

+ 1 - 3
vrobbler/apps/music/aggregators.py

@@ -1,13 +1,11 @@
 from datetime import datetime, timedelta
-from typing import List
 
 from django.apps import apps
 from django.db.models import Count, Q, QuerySet
 from django.utils import timezone
-from music.models import Artist, Track
+from profiles.utils import now_user_timezone
 from scrobbles.models import Scrobble
 from videos.models import Video
-from vrobbler.apps.profiles.utils import now_user_timezone
 
 
 def scrobble_counts(user=None):

+ 2 - 2
vrobbler/apps/scrobbles/models.py

@@ -16,7 +16,7 @@ from scrobbles.utils import check_scrobble_for_finish
 from sports.models import SportEvent
 from videos.models import Series, Video
 
-from vrobbler.apps.profiles.utils import (
+from profiles.utils import (
     end_of_day,
     end_of_month,
     end_of_week,
@@ -24,7 +24,7 @@ from vrobbler.apps.profiles.utils import (
     start_of_month,
     start_of_week,
 )
-from vrobbler.apps.scrobbles.stats import build_charts
+from scrobbles.stats import build_charts
 
 logger = logging.getLogger(__name__)
 User = get_user_model()

+ 6 - 6
vrobbler/apps/scrobbles/scrobblers.py

@@ -5,16 +5,16 @@ from dateutil.parser import parse
 from django.utils import timezone
 from music.constants import JELLYFIN_POST_KEYS
 from music.models import Track
-from podcasts.models import Episode
-from scrobbles.models import Scrobble
-from scrobbles.utils import convert_to_seconds, parse_mopidy_uri
-from videos.models import Video
-from sports.models import SportEvent
-from vrobbler.apps.music.utils import (
+from music.utils import (
     get_or_create_album,
     get_or_create_artist,
     get_or_create_track,
 )
+from podcasts.models import Episode
+from scrobbles.models import Scrobble
+from scrobbles.utils import convert_to_seconds, parse_mopidy_uri
+from sports.models import SportEvent
+from videos.models import Video
 
 logger = logging.getLogger(__name__)
 

+ 1 - 2
vrobbler/apps/scrobbles/tasks.py

@@ -7,8 +7,7 @@ from scrobbles.models import (
     KoReaderImport,
     LastFmImport,
 )
-
-from vrobbler.apps.scrobbles.stats import build_yesterdays_charts_for_user
+from scrobbles.stats import build_yesterdays_charts_for_user
 
 logger = logging.getLogger(__name__)
 User = get_user_model()

+ 1 - 3
vrobbler/apps/scrobbles/views.py

@@ -17,7 +17,7 @@ from django.views.decorators.csrf import csrf_exempt
 from django.views.generic import DetailView, FormView, TemplateView
 from django.views.generic.edit import CreateView
 from django.views.generic.list import ListView
-from music.aggregators import scrobble_counts, week_of_scrobbles
+from music.aggregators import live_charts, scrobble_counts, week_of_scrobbles
 from rest_framework import status
 from rest_framework.decorators import (
     api_view,
@@ -57,8 +57,6 @@ from scrobbles.tasks import (
 from sports.thesportsdb import lookup_event_from_thesportsdb
 from videos.imdb import lookup_video_from_imdb
 
-from vrobbler.apps.music.aggregators import live_charts
-
 logger = logging.getLogger(__name__)
 
 

+ 1 - 0
vrobbler/settings.py

@@ -157,6 +157,7 @@ if TESTING:
     DATABASES = {
         "default": dj_database_url.config(default="sqlite:///testdb.sqlite3")
     }
+
 db_str = ""
 if 'sqlite' in DATABASES['default']['ENGINE']:
     db_str = f"Connected to sqlite@{DATABASES['default']['NAME']}"