mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
fix(feeds): keep Switch files with uppercase extensions in the Tinfoil feed (#5115)
This commit is contained in:
@@ -253,7 +253,7 @@ async def tinfoil_index_feed(
|
||||
)
|
||||
for rom in roms
|
||||
for rom_file in rom.files
|
||||
if rom_file.file_extension in ["xci", "nsp", "nsz", "xcz", "nro"]
|
||||
if rom_file.file_extension.lower() in ["xci", "nsp", "nsz", "xcz", "nro"]
|
||||
],
|
||||
directories=[],
|
||||
success=TINFOIL_WELCOME_MESSAGE,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import pytest
|
||||
from fastapi import status
|
||||
from fastapi.testclient import TestClient
|
||||
from tests.factories import make_rom
|
||||
@@ -74,7 +75,8 @@ def test_webrcade_feed_skips_roms_without_a_file(
|
||||
assert [item["title"] for item in items] == [rom.name]
|
||||
|
||||
|
||||
def test_tinfoil_feed(client: TestClient, platform: Platform, rom: Rom):
|
||||
@pytest.mark.parametrize("file_name", ["Test Switch.nsp", "Test Switch.NSP"])
|
||||
def test_tinfoil_feed(client: TestClient, platform: Platform, rom: Rom, file_name: str):
|
||||
platform = db_platform_handler.update_platform(
|
||||
platform.id,
|
||||
{"name": "Nintendo Switch", "slug": UPS.SWITCH, "fs_slug": UPS.SWITCH},
|
||||
@@ -97,7 +99,7 @@ def test_tinfoil_feed(client: TestClient, platform: Platform, rom: Rom):
|
||||
db_rom_handler.add_rom_file(
|
||||
RomFile(
|
||||
rom_id=rom.id,
|
||||
file_name="Test Switch.nsp",
|
||||
file_name=file_name,
|
||||
file_path=rom.fs_path,
|
||||
file_size_bytes=456,
|
||||
sha1_hash="beadfeed",
|
||||
|
||||
Reference in New Issue
Block a user