Skip to content

Add basic game detection + scan tools on import, Speed up thumbnails #379

Merged
ShaneIsrael merged 9 commits intoShaneIsrael:developfrom
dammitjeff:clean-caching
Jan 15, 2026
Merged

Add basic game detection + scan tools on import, Speed up thumbnails #379
ShaneIsrael merged 9 commits intoShaneIsrael:developfrom
dammitjeff:clean-caching

Conversation

@dammitjeff
Copy link
Contributor

• Added Caching headers, speeding up game tab and video thumbnail load times. Previously, the browser would keep thumbnails and game assets in cache, but would revalidate every single time you clicked on the Games or My Videos Tab. The browser is allowed to skip revalidation until the max‑age expires (I have it set to 7 days by default), so those 40 thumbnails don’t generate 40 network requests every time.

• Added basic primitive fuzzy search for video files using RapidFuzz. When importing a new video, the server will clean the filename, attempt to match it against your existing database, and suggest an existing game. If it cannot find an existing game, it will search SteamgridDB as a fallback. Hitting confirm will create a new game and auto link for you. Also created new GameDetectionCard.js card to keep things tidy, or in case we must refer to it in the future.
Screenshot 2026-01-14 at 2 54 34 PM

This does require installing new Python deps (rapidfuzz added to requirements.txt), so re-pull the latest image if it doesn't work.

• Added Start Manual Scan for Missing Games button in Settings. Since this system currently only works for new uploads, figured we could use a button to manually search all videos that do not have a game attached.
Screenshot 2026-01-14 at 2 57 43 PM
Screenshot 2026-01-14 at 3 23 21 PM

Gotta stress this needs some bug testing. I assume this will require some UI tweaks, but also looking for edge cases or bugs in the way it handles strings file names that it can't recognize. I based this heavily off of the Nvidia shadowplay structure of naming games, but it should be able to fuzzy search most file names. It's not going to be able to detect it perfectly every time, but if we get like 90% of obvious searches correct, I'll be happy haha.

Full disclosure, Claude was used to develop segments of this code, but was closely reviewed by a real human.

@ShaneIsrael
Copy link
Owner

Hey, I'll definitely give this some heavy testing. Will probably put it into the develop branch later tonight as that's (sadly) the easiest way for me to test right now. May not get you any feedback though until tomorrow.

Was also wondering if you could address this issue. I actually didn't even realize this in my tests because I was just excited to have this feature that I'll be using, but if the api key isn't provided could we default the games tab to hidden? Or it could be an additional toggle setting to enable/disable it so you don't have to lose your key.

#378

@ShaneIsrael
Copy link
Owner

@dammitjeff Okay merging to the develop build. Should be able to find time either today or tomorrow to test.

@ShaneIsrael ShaneIsrael merged commit 682dfb0 into ShaneIsrael:develop Jan 15, 2026
@ShaneIsrael
Copy link
Owner

@dammitjeff So one issue so far, the games tab seems to be broken now. When I try to open a game category I am met with this error.

2026-01-16 18:59:00,152 ERROR   app.log_exception:1455 | Exception on /api/games/5309258/videos [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.10/dist-packages/fireshare/api.py", line 833, in get_game_videos
    vjson = link.video.json()
AttributeError: 'NoneType' object has no attribute 'json'
[2026-01-16 18:59:00,152] ERROR in app: Exception on /api/games/5309258/videos [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.10/dist-packages/fireshare/api.py", line 833, in get_game_videos
    vjson = link.video.json()
AttributeError: 'NoneType' object has no attribute 'json'

@dammitjeff
Copy link
Contributor Author

Hmm, when you mean broken, do you get hit by a white screen by chance? Or does nothing end up loading?

@ShaneIsrael
Copy link
Owner

The React page doesn't break, but it acts as if there are no results which makes sense because it's throwing the 500 when trying to fetch them.
image

The categories still show up fine. Its just when you try to go into a category that you get my screenshot above.

Also, when you start the manual scan for game suggestions you get this after a couple seconds if the scan is still going. In my case, that scan is going to take a good while so I think this is just the connection timing out. Probably should just let it continue and not wait for a response.

image

@ShaneIsrael
Copy link
Owner

I also noticed a lot of the suggestions are very wrong if the video file name is just numbers or doesn't include the game name.
image

Is it possible we can primarily use the folder name that the video is in, but fallback to file name if the video is in one of the upload folders or if the fuzzy search isn't confident?

@dammitjeff
Copy link
Contributor Author

dammitjeff commented Jan 17, 2026

The React page doesn't break, but it acts as if there are no results which makes sense because it's throwing the 500 when trying to fetch them.

Is the v.fireshare url the one that you're running this dev page on? If so, it seems like all the other games seem to load their clips just fine, but arc raiders is the only one that's having that issue. I do see that you have arc clips public. Are they tagged correctly with the game Arc raiders by chance?

when you start the manual scan for game suggestions you get this after a couple seconds if the scan is still going.

Noted. Yeah it hasn't failed, just longer libraries will take a bit longer, and the error gets a bit jumpy and errors out. I'll make sure to program in a solution for bigger libraries.

a lot of the suggestions are very wrong if the video file name is just numbers or doesn't include the game name.

Correct yeah, if it's got nothing in there, it's gonna guess very poorly, that's the downside of this method. I could definitely program in to search the file path of the location of the videos first. The issue gets a bit more complicated when uploading from the site, as the way the app is programmed right now, it cannot read file paths of external folders. We can scan local file paths though, just needs some time.

For now, a good solution is to use the edit button > select all your clips from that folder > link clips that way.

@dammitjeff
Copy link
Contributor Author

Big reason I prioritized File name first, is because at least on the Nvidia/PS4/PS5 side, the default naming scheme of all file clips from these devices tend to have the game name in the file name itself. It's more likely to hit an accurate guess. Unless we can have a more elegant solution, we might be hitting some issues if a user has a subfolder name "PS4>Share>Overwatch" and then the game detected is gonna be "Share (2016)"
Screenshot 2026-01-16 at 6 36 47 PM
Screenshot 2026-01-16 at 6 37 41 PM

@ShaneIsrael
Copy link
Owner

Hmm. Maybe a setting where you can choose your preferred method?

(Folder name and fallback to filename) or (Filename and fallback to folder name)

@dammitjeff
Copy link
Contributor Author

We could def plan to add that in the future, consider this just version 1 of the game detection system. I think this will still help out a lotttt of people compared to having no system haha. Let me get a fix on that "Failed to scan videos for games" error for you

@ShaneIsrael
Copy link
Owner

Sure. I wonder if as a compromise for now if a file only has numbers/special characters in the name that it fallback to folder name? At least for me most of my files are just timestamp names with no title to them.

@dammitjeff
Copy link
Contributor Author

Yeah, that could be done, especially if it's all numbers. We'll have a small sliver of games that will be falsely flagged as dates if their title is only numbers, but it's gonna have to be a compromise.

I've added a status indicator in the sidebar for now, GameDetectionCard.js that auto updates as the games are scanned. Unfortunately I don't have nearly a big enough library of videos to test this out haha, so hopefully you can let me know how it works. I'll request a PR in a sec.
Screenshot 2026-01-17 at 12 51 28 AM

@dammitjeff
Copy link
Contributor Author

Oh we're so back. Gimme a sec to test this a little more.
Screenshot 2026-01-17 at 11 38 00 AM

@ShaneIsrael
Copy link
Owner

Unfortunately I don't have nearly a big enough library of videos to test this out haha, so hopefully you can let me know how it works. I'll request a PR in a sec.

Yeah I'll do my best unfortunately I've already tagged most of my library to a game so I won't be able to do a large dataset test but I can easily add a couple new game clips with timestamp only titles to test.

@ShaneIsrael
Copy link
Owner

ShaneIsrael commented Jan 18, 2026

@dammitjeff Not sure if this is part of this PR but I noticed that on the games tab the search videos field at the top doesn't seem to work.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants