Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Branch v1.7.0 into main #348

Merged
merged 14 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions gaseous-server/Controllers/V1.0/GamesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SignInManager<ApplicationUser> signInManager
[MapToApiVersion("1.0")]
[HttpGet]
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
public ActionResult Game(
public async Task<ActionResult> Game(
string name = "",
string platform = "",
string genre = "",
Expand Down Expand Up @@ -303,7 +303,7 @@ public static List<Game> GetGames(
[ProducesResponseType(typeof(Game), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "5Minute")]
public ActionResult Game(long GameId)
public async Task<ActionResult> Game(long GameId)
{
try
{
Expand Down Expand Up @@ -331,7 +331,7 @@ public ActionResult Game(long GameId)
[ProducesResponseType(typeof(List<AlternativeName>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameAlternativeNames(long GameId)
public async Task<ActionResult> GameAlternativeNames(long GameId)
{
try
{
Expand Down Expand Up @@ -364,7 +364,7 @@ public ActionResult GameAlternativeNames(long GameId)
[ProducesResponseType(typeof(List<AgeRatings.GameAgeRating>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameAgeClassification(long GameId)
public async Task<ActionResult> GameAgeClassification(long GameId)
{
try
{
Expand Down Expand Up @@ -397,7 +397,7 @@ public ActionResult GameAgeClassification(long GameId)
[ProducesResponseType(typeof(List<Artwork>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameArtwork(long GameId)
public async Task<ActionResult> GameArtwork(long GameId)
{
try
{
Expand Down Expand Up @@ -428,7 +428,7 @@ public ActionResult GameArtwork(long GameId)
[ProducesResponseType(typeof(Artwork), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameArtwork(long GameId, long ArtworkId)
public async Task<ActionResult> GameArtwork(long GameId, long ArtworkId)
{
try
{
Expand Down Expand Up @@ -464,7 +464,7 @@ public ActionResult GameArtwork(long GameId, long ArtworkId)
[Route("{GameId}/artwork/{ArtworkId}/image/{size}/{ImageName}")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameCoverImage(long GameId, long ArtworkId, Communications.IGDBAPI_ImageSize size, string ImageName)
public async Task<ActionResult> GameCoverImage(long GameId, long ArtworkId, Communications.IGDBAPI_ImageSize size, string ImageName)
{
try
{
Expand Down Expand Up @@ -531,7 +531,7 @@ public ActionResult GameCoverImage(long GameId, long ArtworkId, Communications.I
[ProducesResponseType(typeof(Cover), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameCover(long GameId)
public async Task<ActionResult> GameCover(long GameId)
{
try
{
Expand Down Expand Up @@ -566,7 +566,7 @@ public ActionResult GameCover(long GameId)
[Route("{GameId}/cover/image/{size}/{imagename}")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameCoverImage(long GameId, Communications.IGDBAPI_ImageSize size, string imagename = "")
public async Task<ActionResult> GameCoverImage(long GameId, Communications.IGDBAPI_ImageSize size, string imagename = "")
{
try
{
Expand Down Expand Up @@ -693,7 +693,7 @@ public async Task<ActionResult> GameSetFavouriteAsync(long GameId, bool favourit
[ProducesResponseType(typeof(List<Genre>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameGenre(long GameId)
public async Task<ActionResult> GameGenre(long GameId)
{
try
{
Expand Down Expand Up @@ -731,7 +731,7 @@ public ActionResult GameGenre(long GameId)
[ProducesResponseType(typeof(List<Dictionary<string, object>>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameInvolvedCompanies(long GameId)
public async Task<ActionResult> GameInvolvedCompanies(long GameId)
{
try
{
Expand Down Expand Up @@ -776,7 +776,7 @@ public ActionResult GameInvolvedCompanies(long GameId)
[ProducesResponseType(typeof(Dictionary<string, object>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameInvolvedCompanies(long GameId, long CompanyId)
public async Task<ActionResult> GameInvolvedCompanies(long GameId, long CompanyId)
{
try
{
Expand Down Expand Up @@ -818,7 +818,7 @@ public ActionResult GameInvolvedCompanies(long GameId, long CompanyId)
[Route("{GameId}/companies/{CompanyId}/image")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameCompanyImage(long GameId, long CompanyId)
public async Task<ActionResult> GameCompanyImage(long GameId, long CompanyId)
{
try
{
Expand Down Expand Up @@ -863,7 +863,7 @@ public ActionResult GameCompanyImage(long GameId, long CompanyId)
[Route("{GameId}/platforms")]
[ProducesResponseType(typeof(List<KeyValuePair<long, string>>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GamePlatforms(long GameId)
public async Task<ActionResult> GamePlatforms(long GameId)
{
try
{
Expand All @@ -882,7 +882,7 @@ public ActionResult GamePlatforms(long GameId)
[ProducesResponseType(typeof(List<ReleaseDate>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameReleaseDates(long GameId)
public async Task<ActionResult> GameReleaseDates(long GameId)
{
try
{
Expand Down Expand Up @@ -943,7 +943,7 @@ public async Task<ActionResult> GameRomAsync(long GameId, int pageNumber = 0, in
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
//[ResponseCache(CacheProfileName = "5Minute")]
public ActionResult GameRom(long GameId, long RomId)
public async Task<ActionResult> GameRom(long GameId, long RomId)
{
try
{
Expand Down Expand Up @@ -972,7 +972,7 @@ public ActionResult GameRom(long GameId, long RomId)
[Route("{GameId}/roms/{RomId}")]
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomRename(long GameId, long RomId, long NewPlatformId, long NewGameId)
public async Task<ActionResult> GameRomRename(long GameId, long RomId, long NewPlatformId, long NewGameId)
{
try
{
Expand Down Expand Up @@ -1002,7 +1002,7 @@ public ActionResult GameRomRename(long GameId, long RomId, long NewPlatformId, l
[Route("{GameId}/roms/{RomId}")]
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomDelete(long GameId, long RomId)
public async Task<ActionResult> GameRomDelete(long GameId, long RomId)
{
try
{
Expand Down Expand Up @@ -1034,7 +1034,7 @@ public ActionResult GameRomDelete(long GameId, long RomId)
[Route("{GameId}/roms/{RomId}/file")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomFile(long GameId, long RomId)
public async Task<ActionResult> GameRomFile(long GameId, long RomId)
{
try
{
Expand Down Expand Up @@ -1073,7 +1073,7 @@ public ActionResult GameRomFile(long GameId, long RomId)
[Route("{GameId}/roms/{RomId}/{FileName}")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomFile(long GameId, long RomId, string FileName)
public async Task<ActionResult> GameRomFile(long GameId, long RomId, string FileName)
{
try
{
Expand Down Expand Up @@ -1172,7 +1172,7 @@ public async Task<ActionResult> GetGameRomGroupAsync(long GameId)
[Route("{GameId}/romgroup")]
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult NewGameRomGroup(long GameId, long PlatformId, [FromBody] List<long> RomIds)
public async Task<ActionResult> NewGameRomGroup(long GameId, long PlatformId, [FromBody] List<long> RomIds)
{
try
{
Expand Down Expand Up @@ -1233,7 +1233,7 @@ public async Task<ActionResult> GameRomGroupMembersAsync(long GameId, long RomGr
[Route("{GameId}/romgroup/{RomGroupId}")]
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomGroupDelete(long GameId, long RomGroupId)
public async Task<ActionResult> GameRomGroupDelete(long GameId, long RomGroupId)
{
try
{
Expand Down Expand Up @@ -1266,7 +1266,7 @@ public ActionResult GameRomGroupDelete(long GameId, long RomGroupId)
[Route("{GameId}/romgroup/{RomGroupId}/{filename}")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameRomGroupFile(long GameId, long RomGroupId, string filename = "")
public async Task<ActionResult> GameRomGroupFile(long GameId, long RomGroupId, string filename = "")
{
try
{
Expand Down Expand Up @@ -1311,7 +1311,7 @@ public ActionResult GameRomGroupFile(long GameId, long RomGroupId, string filena
[Route("search")]
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameSearch(long RomId = 0, string SearchString = "")
public async Task<ActionResult> GameSearch(long RomId = 0, string SearchString = "")
{
try
{
Expand Down Expand Up @@ -1352,7 +1352,7 @@ public ActionResult GameSearch(long RomId = 0, string SearchString = "")
[ProducesResponseType(typeof(List<Screenshot>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameScreenshot(long GameId)
public async Task<ActionResult> GameScreenshot(long GameId)
{
try
{
Expand Down Expand Up @@ -1383,7 +1383,7 @@ public ActionResult GameScreenshot(long GameId)
[ProducesResponseType(typeof(Screenshot), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameScreenshot(long GameId, long ScreenshotId)
public async Task<ActionResult> GameScreenshot(long GameId, long ScreenshotId)
{
try
{
Expand Down Expand Up @@ -1417,7 +1417,7 @@ public ActionResult GameScreenshot(long GameId, long ScreenshotId)
[Route("{GameId}/screenshots/{ScreenshotId}/image/{size}/{ImageName}")]
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult GameScreenshotImage(long GameId, long ScreenshotId, Communications.IGDBAPI_ImageSize Size, string ImageName)
public async Task<ActionResult> GameScreenshotImage(long GameId, long ScreenshotId, Communications.IGDBAPI_ImageSize Size, string ImageName)
{
try
{
Expand Down Expand Up @@ -1468,7 +1468,7 @@ public ActionResult GameScreenshotImage(long GameId, long ScreenshotId, Communic
[ProducesResponseType(typeof(List<GameVideo>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ResponseCache(CacheProfileName = "7Days")]
public ActionResult GameVideo(long GameId)
public async Task<ActionResult> GameVideo(long GameId)
{
try
{
Expand Down
26 changes: 16 additions & 10 deletions gaseous-server/Controllers/V1.1/GamesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,23 +593,29 @@ LEFT JOIN

// build alpha list
Dictionary<string, int> AlphaList = new Dictionary<string, int>();
int CurrentPage = 0;
int NextPageIndex = 0;
int CurrentPage = 1;
int NextPageIndex = pageSize;
for (int i = 0; i < dbResponse.Rows.Count; i++)
{
string firstChar = dbResponse.Rows[i]["NameThe"].ToString().Substring(0, 1).ToUpperInvariant();
if (!"ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(firstChar))
{
firstChar = "#";
}
if (!AlphaList.ContainsKey(firstChar))
{
AlphaList.Add(firstChar, CurrentPage);
if (!AlphaList.ContainsKey("#"))
{
AlphaList.Add("#", 1);
}
}
if (NextPageIndex == i)
else
{
NextPageIndex += pageSize;
CurrentPage += 1;
if (!AlphaList.ContainsKey(firstChar))
{
AlphaList.Add(firstChar, CurrentPage);
}
if (NextPageIndex == i + 1)
{
NextPageIndex += pageSize;
CurrentPage += 1;
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion gaseous-server/wwwroot/pages/dialogs/userprofile.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ <h3>Game Library</h3>
</table>
</td>
</tr>
<tr>
<td>
<strong>Note</strong>: The page will need to be reloaded for changes to take effect.
</td>
</tr>
<tr>
<td style="text-align: right;">
<button id="profile_pref_ok" value="OK" onclick="SavePrefs();">OK</button>
Expand Down Expand Up @@ -221,7 +226,7 @@ <h3>Reset Password</h3>

if (getQueryString('page', 'string') == 'home' || getQueryString('page', 'string') == undefined) {
setCookie('games_library_last_page', 1);
location.reload();
//location.reload();
}

closeDialog();
Expand Down
2 changes: 1 addition & 1 deletion gaseous-server/wwwroot/scripts/filterformating.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function executeFilter1_1(pageNumber, pageSize) {
if (!pageSize) {
switch (pageMode) {
case "infinite":
pageSize = 5;
pageSize = 30;
break;
case "paged":
default:
Expand Down
Loading
Loading