Skip to content

Commit

Permalink
Fix troi.patch imports (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
amCap1712 authored Apr 29, 2024
1 parent ced8785 commit 7a89353
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions troi/patches/ai_jams.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import troi.external.gpt
import troi.musicbrainz.mbid_mapping
import troi.patch
from troi import Playlist
from troi.patch import Patch
from troi.playlist import PlaylistMakerElement


class AiJamsPatch(troi.patch.Patch):
class AiJamsPatch(Patch):
""" Generate a playlist using AI from the given prompt. """

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions troi/patches/lb_radio_classes/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from troi import Recording
from troi import TARGET_NUMBER_OF_RECORDINGS


class LBRadioPlaylistRecordingElement(troi.Element):
"""
Given an LB playlist, fetch its tracks and randomly include recordiungs from it. mode does not
Expand Down
4 changes: 2 additions & 2 deletions troi/patches/periodic_jams_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import troi.listenbrainz.recs
import troi.musicbrainz.recording_lookup
from troi import Playlist
from troi.patch import Patch
from troi.playlist import PlaylistMakerElement

from troi.local.recording_resolver import RecordingResolverElement
from troi.content_resolver.model.database import db

DAYS_OF_RECENT_LISTENS_TO_EXCLUDE = 60 # Exclude tracks listened in last X days from the daily jams playlist
DAILY_JAMS_MIN_RECORDINGS = 25 # the minimum number of recordings we aspire to have in a daily jam, this is not a hard limit
BATCH_SIZE_RECS = 1000 # the number of recommendations fetched in 1 go
MAX_RECS_LIMIT = 1000 # the maximum of recommendations available in LB


class PeriodicJamsLocalPatch(troi.patch.Patch):
class PeriodicJamsLocalPatch(Patch):
"""
"""

Expand Down
1 change: 0 additions & 1 deletion troi/patches/playlist_from_listenbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from troi import Playlist
from troi.patch import Patch
from troi.playlist import PlaylistFromJSPFElement
import troi.musicbrainz.recording_lookup


class TransferPlaylistPatch(Patch):
Expand Down
5 changes: 3 additions & 2 deletions troi/patches/playlist_from_mbids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
from troi import Recording
from troi.musicbrainz.mbid_reader import MBIDReaderElement
from troi.musicbrainz.recording_lookup import RecordingLookupElement
from troi.patch import Patch
from troi.playlist import PlaylistMakerElement


class PlaylistFromMBIDsPatch(troi.patch.Patch):
class PlaylistFromMBIDsPatch(Patch):
"""
"""

def __init__(self, args):
troi.patch.Patch.__init__(self, args)
super().__init__(args)

@staticmethod
def inputs():
Expand Down
5 changes: 3 additions & 2 deletions troi/patches/recs_to_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import troi.sorts
import troi.musicbrainz.recording_lookup
import troi.musicbrainz.mbid_mapping
from troi.patch import Patch


class RecsPlaylistMakerElement(Element):
Expand Down Expand Up @@ -53,13 +54,13 @@ def read(self, inputs):
user_name=self.user_name)]


class RecommendationsToPlaylistPatch(troi.patch.Patch):
class RecommendationsToPlaylistPatch(Patch):
"""
See below for description
"""

def __init__(self, args):
troi.patch.Patch.__init__(self, args)
super().__init__(args)

@staticmethod
def inputs():
Expand Down

0 comments on commit 7a89353

Please sign in to comment.