-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1416 from rommapp/feature/screenscraper-integration
feat: Screenscraper integration
- Loading branch information
Showing
68 changed files
with
1,959 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"""empty message | ||
Revision ID: 0035_screenscraper | ||
Revises: 0034_virtual_collections_db_view | ||
Create Date: 2025-01-02 18:58:55.557123 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from utils.database import CustomJSON | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0035_screenscraper" | ||
down_revision = "0034_virtual_collections_db_view" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("platforms", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("ss_id", sa.Integer(), nullable=True)) | ||
|
||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("ss_id", sa.Integer(), nullable=True)) | ||
batch_op.add_column(sa.Column("ss_metadata", CustomJSON(), nullable=True)) | ||
batch_op.add_column(sa.Column("url_manual", sa.Text(), nullable=True)), | ||
batch_op.add_column(sa.Column("path_manual", sa.Text(), nullable=True)), | ||
batch_op.create_index("idx_roms_ss_id", ["ss_id"], unique=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.drop_index("idx_roms_ss_id") | ||
batch_op.drop_column("ss_id") | ||
batch_op.drop_column("ss_metadata") | ||
batch_op.drop_column("url_manual") | ||
batch_op.drop_column("path_manual") | ||
batch_op.drop_index("idx_roms_ss_id") | ||
|
||
with op.batch_alter_table("platforms", schema=None) as batch_op: | ||
batch_op.drop_column("ss_id") | ||
# ### end Alembic commands ### |
34 changes: 34 additions & 0 deletions
34
backend/alembic/versions/0036_screenscraper_platforms_id.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""empty message | ||
Revision ID: 0036_screenscraper_platforms_id | ||
Revises: 0035_screenscraper | ||
Create Date: 2025-01-02 18:58:55.557123 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from handler.metadata.ss_handler import SLUG_TO_SS_ID | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0036_screenscraper_platforms_id" | ||
down_revision = "0035_screenscraper" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
connection = op.get_bind() | ||
for slug, ss_id in SLUG_TO_SS_ID.items(): | ||
connection.execute( | ||
sa.text("UPDATE platforms SET ss_id = :ss_id WHERE slug = :slug"), | ||
{"ss_id": ss_id["id"], "slug": slug}, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.