Explorar o código

Merge branch 'develop'

Colin Powell hai 3 días
pai
achega
d3a15d5e7b

+ 29 - 0
vrobbler/apps/puzzles/migrations/0003_rename_igdb_id_puzzle_ipdb_id_and_more.py

@@ -0,0 +1,29 @@
+# Generated by Django 4.2.19 on 2025-05-11 03:58
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("puzzles", "0002_alter_puzzle_dimensions_in_inches"),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name="puzzle",
+            old_name="igdb_id",
+            new_name="ipdb_id",
+        ),
+        migrations.RemoveField(
+            model_name="puzzle",
+            name="igdb_image",
+        ),
+        migrations.AddField(
+            model_name="puzzle",
+            name="ipdb_image",
+            field=models.ImageField(
+                blank=True, null=True, upload_to="puzzles/ipdb/"
+            ),
+        ),
+    ]

+ 9 - 9
vrobbler/apps/puzzles/models.py

@@ -31,17 +31,17 @@ class Puzzle(ScrobblableMixin):
     material = models.CharField(max_length=50, **BNULL)
     cut_style = models.CharField(max_length=100, **BNULL)
     pieces_count = models.IntegerField(**BNULL)
-    igdb_id = models.CharField(max_length=255, **BNULL)
+    ipdb_id = models.CharField(max_length=255, **BNULL)
     barcode = models.CharField(max_length=13, **BNULL)
-    igdb_image = models.ImageField(upload_to="puzzles/igdb/", **BNULL)
-    igdb_image_small = ImageSpecField(
-        source="igdb_image",
+    ipdb_image = models.ImageField(upload_to="puzzles/ipdb/", **BNULL)
+    ipdb_image_small = ImageSpecField(
+        source="ipdb_image",
         processors=[ResizeToFit(100, 100)],
         format="JPEG",
         options={"quality": 60},
     )
-    igdb_image_medium = ImageSpecField(
-        source="igdb_image",
+    ipdb_image_medium = ImageSpecField(
+        source="ipdb_image",
         processors=[ResizeToFit(300, 300)],
         format="JPEG",
         options={"quality": 75},
@@ -65,10 +65,10 @@ class Puzzle(ScrobblableMixin):
         return ScrobblableConstants(verb="Solving", tags="puzzle")
 
     @property
-    def igdb_link(self) -> str:
+    def ipdb_link(self) -> str:
         link = ""
-        if self.igdb_id:
-            link = f"https://www.ipdb.plus/IPDb/puzzle.php?id={self.igdb_id}"
+        if self.ipdb_id:
+            link = f"https://www.ipdb.plus/IPDb/puzzle.php?id={self.ipdb_id}"
         return link
 
     @property