Commit graph

52 commits

Author SHA1 Message Date
Pat Hartl
d7e0646da4 Update packages 2024-12-06 23:30:00 -06:00
Pat Hartl
7084cd75d3 Fix page slug generation to avoid collision, fix page slug editor 2024-11-30 02:09:10 -06:00
Pat Hartl
161974f884 Fix editing of roles, change method of repository Update 2024-11-27 19:36:44 -06:00
Pat Hartl
f8074c4afb Create short-lived scopes for Blazor usage 2024-11-27 03:09:00 -06:00
Pat Hartl
1a21aa34fe Fix user service unusable when in scope 2024-11-27 01:55:59 -06:00
Pat Hartl
5de9eccce1 Adjust Blazor server-side to pull data with new context 2024-11-25 22:29:56 -06:00
Pat Hartl
b52c84992e Remove mutex 2024-11-22 02:13:32 -06:00
Pat Hartl
1dda11dd0a Switch dependency injection for services that access database 2024-11-22 02:04:04 -06:00
Pat Hartl
67cef0aea6 Fix logic for saving thumbs as PNG 2024-11-15 23:22:15 -06:00
Pat Hartl
3614dae4ca When adding/removing, handle base game and dependent games 2024-11-15 02:25:40 -06:00
Pat Hartl
62ceffc976 Merge branch 'user-libraries' of https://github.com/LANCommander/LANCommander into user-libraries
# Conflicts:
#	LANCommander.Server.Services/LibraryService.cs
2024-11-12 21:02:28 -06:00
Pat Hartl
00b9ca5953 Rename service and repository methods to async 2024-11-12 18:32:46 -06:00
Pat Hartl
4f5324ce1b Expire user library cache when adding/removing 2024-11-12 02:34:27 -06:00
Pat Hartl
82caf0529a Get user using existing method 2024-11-12 02:17:42 -06:00
Pat Hartl
3611cedb67 Implement interface properly 2024-11-12 00:00:31 -06:00
Pat Hartl
63d203f87f Map DepotGame cover from attached media 2024-11-11 20:20:02 -06:00
Pat Hartl
b5bddf806d Optimize controller routes for getting depot and library games 2024-11-11 18:22:30 -06:00
Pat Hartl
3440345868 Add ability to project to another datatype in repo
This commit adds the ability for database requests to be projected to another datatype using AutoMapper. This is extremely useful for grabbing large amounts of data from the database and mapping it to another datatype without the overhead of mapping it post-query.
2024-11-11 18:18:59 -06:00
Pat Hartl
ddce80d296 Rename semaphore to mutex 2024-11-08 00:39:55 -06:00
Pat Hartl
eaa4b862f6 Make user service use mutex 2024-11-08 00:38:47 -06:00
Pat Hartl
a4eb19ffb0 Generate thumbnail for PNG as JPEG if no transparent pixels 2024-11-07 18:55:10 -06:00
Pat Hartl
a98c2c92a2 Add route to get thumbnail 2024-11-07 18:54:46 -06:00
Pat Hartl
51a8a5cdb7 Log any exceptions for generating thumbnails 2024-11-07 02:17:08 -06:00
Pat Hartl
620c8d5d2d Check that source file for thumbnail already exists 2024-11-07 02:16:57 -06:00
Pat Hartl
40cd698510 Fix PDF thumbnail generation 2024-11-07 02:16:42 -06:00
Pat Hartl
8996c04c83 Add eager loading to repo. Move semaphore to DbContext. Inject DbContext instead of factory to open less connections 2024-11-07 01:40:05 -06:00
Pat Hartl
1fc74d22dd Add background job for generating all thumbnails 2024-11-05 19:39:32 -06:00
Pat Hartl
ce105a285f Rename GetImagePath -> GetMediaPath 2024-11-05 19:38:59 -06:00
Pat Hartl
262cbacc52 Fix upload location for media 2024-11-05 19:23:29 -06:00
Pat Hartl
5fa37ef257 Generate thumbnails on upload for all media types 2024-11-05 19:22:59 -06:00
Pat Hartl
e30a1baef3 Start of migrations, services, controllers 2024-10-31 01:54:34 -05:00
Pat Hartl
25a4766b7d Use semaphores to make DbContext access in a repository safer 2024-10-30 18:15:02 -05:00
Pat Hartl
24acb5e1bd Cache service calls from database for all of entity type for 30 seconds 2024-10-30 17:44:10 -05:00
Pat Hartl
6dfc8bae80 Fix extraction of autoupdater
Fixes #140
2024-10-29 18:27:40 -05:00
Pat Hartl
0821dfde5c Merge tag 'v1.0.4' into v1.1.0
# Conflicts:
#	LANCommander.Launcher.Services/InstallService.cs
#	LANCommander.Launcher.Services/ProfileService.cs
#	LANCommander.Launcher/UI/Components/DownloadQueue.razor
#	LANCommander.Launcher/wwwroot/css/app.css.map
#	LANCommander.SDK/Enums/InstallStatus.cs
2024-10-28 01:01:57 -05:00
Pat Hartl
42b09c5156 More Now -> UtcNow 2024-10-23 23:19:25 -05:00
Pat Hartl
42ca5c323a WIP MySQL concurrency fixes
- Removed the Blazor authentication pages and went back to Razor pages
- Fixed issues with dashboard charts that were pulling data on render and causing the database context to be open longer than it should
- Switched back to UserManager and RoleManager
- Temporarily disabled authentication state in pages that might try to use user claims/roles
- Reverted spacing changes to forms to allow for validation messages
- Moved initialization of database connection to database context
- Updated PostgreSQL provider
- Rescaffolded MySQL migrations
- Added a bunch of logging stuff that should eventually be stripped out
2024-10-21 20:06:52 -05:00
Pat Hartl
2056b06207 Working new login page 2024-10-18 19:15:05 -05:00
Pat Hartl
ff4702d29f Use short lived DatabaseContext for RoleService 2024-10-16 18:37:16 -05:00
Pat Hartl
c075d8f398 Use short lived database context for UserService methods 2024-10-16 18:32:48 -05:00
Pat Hartl
524f4c9573 Back to managers 2024-10-16 16:29:55 -05:00
Pat Hartl
91829f601d Enable navigation properties for user roles, use service in place of managers 2024-10-16 01:54:51 -05:00
Pat Hartl
14df6bc95c Use custom models for identities 2024-10-15 23:48:16 -05:00
Pat Hartl
2e5ae435bd Move Identity user store to separate database context 2024-10-14 01:29:45 -05:00
Pat Hartl
d33ecc30e0 Remove usage of DatabaseContext outside Repository 2024-10-14 00:59:32 -05:00
Pat Hartl
2805f34449 WIP fix for MySQL connection concurrency issues
This is a large commit. There are a number of things that this commit does to try to fix various issues that were occurring when the database provider was set to MySQL:
- The DAL `Repository` has been completely refactored to follow best practices. The repository is now being injected into services instead of the database context itself. This allows the DI to handle the repository's lifetime instead of creating a new repository for every transaction and sharing the context across repositories. As part of these changes, there is no more allowed usage of `IQueryable` and all service/repository methods must actually execute database queries before their return. This is to ensure that the context does not stay open longer than it needs to. Abusing `IQueryable`s by tossing them into Blazor components seems to be a big no-no.
- Some deletion behaviors on relationships have been tweaked as MySQL wasn't able to apply migrations with behaviors that were contradictory.
- A `ConnectionInterceptor` was added to try to keep track of `DatabaseContext` lifetimes. This is really only for debugging and should be put into `#if DEBUG` regions. This helped identify some potential issues where some contexts were basically never closing, causing the MySQL connector to not function.
- Docs for generating migrations have been updated to reflect the addition of being able to specify the database provider and connection string when adding a migration, avoiding the need to edit `Settings.yml`
- The application can now be put into a pause state on startup by adding the `--debugger` argument when used from the command line. When a debugger is attached, it resumes execution.
- The application can now log to Seq when using debug build
- Service lifetime on `DatabaseContext` has switched to transient. This may be reverted in the future.
- Lazy loading has been disabled for debugging purposes. It didn't directly help the concurrency issues, but it needs to be tested individually to be re-enabled.
- All usage of `UserManager`, `RoleManager`, and `SignInManager` have been removed from all controllers, pages, and Blazor components. Functionality has been moved to `UserService` and `RoleService`. This might have done the most amount of help, but could probably be improved upon in the future by not relying on them and instead having our own implementation.
- Application startup migrations and server autostarts have been disabled temporarily. There might be an issue of `DatabaseContext` lifetimes that spawn from this.
2024-10-13 20:42:45 -05:00
Pat Hartl
e236c2b25b Refactored first time setup
Fixes #128
2024-10-12 18:36:00 -05:00
Pat Hartl
ba18096dde Update packages 2024-10-12 18:33:57 -05:00
Pat Hartl
07882e39d2 Add ability to specify multiple upload folders for archives
Implements #97
2024-10-11 01:09:12 -05:00
Pat Hartl
e083d86d8b Add ability to switch database providers to MySQL or PostgreSQL
Ref #108
2024-10-07 18:52:52 -05:00