Compare commits

..

3 Commits
0.1.8 ... 0.1.9

Author SHA1 Message Date
49889ae297 Bump version to 0.1.9 2023-01-09 17:49:46 -05:00
4d573bc934 Fix bug where video scrobbles never start 2023-01-09 17:49:11 -05:00
bdd0f19161 Add start of a rating model for tracks 2023-01-09 11:20:37 -05:00
4 changed files with 32 additions and 10 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "vrobbler"
version = "0.1.8"
version = "0.1.9"
description = ""
authors = ["Colin Powell <colin@unbl.ink>"]

View File

@ -0,0 +1,25 @@
# Generated by Django 4.1.5 on 2023-01-09 16:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('music', '0003_album_uuid_artist_uuid_track_uuid'),
]
operations = [
migrations.AddField(
model_name='track',
name='thumbs',
field=models.IntegerField(
choices=[
(-1, 'Thumbs down'),
(0, 'No opinion'),
(1, 'Thumbs up'),
],
default=0,
),
),
]

View File

@ -42,6 +42,11 @@ class Artist(TimeStampedModel):
class Track(TimeStampedModel):
class Opinion(models.IntegerChoices):
DOWN = -1, 'Thumbs down'
NEUTRAL = 0, 'No opinion'
UP = 1, 'Thumbs up'
uuid = models.UUIDField(default=uuid4, editable=False, **BNULL)
title = models.CharField(max_length=255, **BNULL)
artist = models.ForeignKey(Artist, on_delete=models.DO_NOTHING)
@ -49,6 +54,7 @@ class Track(TimeStampedModel):
musicbrainz_id = models.CharField(max_length=255, **BNULL)
run_time = models.CharField(max_length=8, **BNULL)
run_time_ticks = models.PositiveBigIntegerField(**BNULL)
thumbs = models.IntegerField(default=Opinion.NEUTRAL, choices=Opinion.choices)
def __str__(self):
return f"{self.title} by {self.artist}"

View File

@ -103,15 +103,6 @@ class Scrobble(TimeStampedModel):
.order_by('-modified')
.first()
)
# Check if playback_position_ticks has changed from this scrobble
scrobble_changed = (
scrobble
and scrobble.playback_position_ticks
!= jellyfin_data['playback_position_ticks']
)
if not scrobble_changed:
logger.info('Scrobble playback has not changed, not scrobbling')
return
# Backoff is how long until we consider this a new scrobble
backoff = timezone.now() + timedelta(minutes=VIDEO_BACKOFF)