mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Pre-Release Shakeout (#1932)
* Allow users to setup an account with a fake email and the same username without hitting the validate username code. * Fixed a bug where opds url could have //. Fixed a bug where baseurl wasn't being used for invite link generation * Fixed enum mismatch causing age rating to display incorrectly on UI
This commit is contained in:
parent
202a35dc7c
commit
e7618861e0
@ -1201,4 +1201,13 @@ public class ReadingListServiceTests
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region CreateReadingListsFromSeries
|
||||||
|
|
||||||
|
// [Fact]
|
||||||
|
// public async Task CreateReadingListsFromSeries_ShouldCreateFromSinglePair()
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -647,7 +647,11 @@ public class AccountController : BaseApiController
|
|||||||
|
|
||||||
// Validate Password and Username
|
// Validate Password and Username
|
||||||
var validationErrors = new List<ApiException>();
|
var validationErrors = new List<ApiException>();
|
||||||
|
// This allows users that use a fake email with the same username to continue setting up the account
|
||||||
|
if (!dto.Username.Equals(dto.Email) && !user.UserName!.Equals(dto.Username))
|
||||||
|
{
|
||||||
validationErrors.AddRange(await _accountService.ValidateUsername(dto.Username));
|
validationErrors.AddRange(await _accountService.ValidateUsername(dto.Username));
|
||||||
|
}
|
||||||
validationErrors.AddRange(await _accountService.ValidatePassword(user, dto.Password));
|
validationErrors.AddRange(await _accountService.ValidatePassword(user, dto.Password));
|
||||||
|
|
||||||
if (validationErrors.Any())
|
if (validationErrors.Any())
|
||||||
|
@ -24,5 +24,6 @@ public class UpdateLibraryDto
|
|||||||
public bool IncludeInSearch { get; init; }
|
public bool IncludeInSearch { get; init; }
|
||||||
[Required]
|
[Required]
|
||||||
public bool ManageCollections { get; init; }
|
public bool ManageCollections { get; init; }
|
||||||
|
[Required]
|
||||||
public bool ManageReadingLists { get; init; }
|
public bool ManageReadingLists { get; init; }
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using API.Constants;
|
|||||||
using API.Data;
|
using API.Data;
|
||||||
using API.Entities;
|
using API.Entities;
|
||||||
using API.Errors;
|
using API.Errors;
|
||||||
|
using Kavita.Common;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@ -67,6 +68,10 @@ public class AccountService : IAccountService
|
|||||||
if (!string.IsNullOrEmpty(serverSettings.HostName))
|
if (!string.IsNullOrEmpty(serverSettings.HostName))
|
||||||
{
|
{
|
||||||
basePart = serverSettings.HostName;
|
basePart = serverSettings.HostName;
|
||||||
|
if (!serverSettings.BaseUrl.Equals(Configuration.DefaultBaseUrl))
|
||||||
|
{
|
||||||
|
basePart += serverSettings.BaseUrl.Substring(0, serverSettings.BaseUrl.Length - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (withHost) return $"{basePart}/registration/{routePart}?token={HttpUtility.UrlEncode(token)}&email={HttpUtility.UrlEncode(email)}";
|
if (withHost) return $"{basePart}/registration/{routePart}?token={HttpUtility.UrlEncode(token)}&email={HttpUtility.UrlEncode(email)}";
|
||||||
|
@ -488,7 +488,7 @@ public class ReadingListService : IReadingListService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IList<Tuple<string, string>> GeneratePairs(string filename, string storyArc, string storyArcNumbers)
|
private IEnumerable<Tuple<string, string>> GeneratePairs(string filename, string storyArc, string storyArcNumbers)
|
||||||
{
|
{
|
||||||
var data = new List<Tuple<string, string>>();
|
var data = new List<Tuple<string, string>>();
|
||||||
if (string.IsNullOrEmpty(storyArc)) return data;
|
if (string.IsNullOrEmpty(storyArc)) return data;
|
||||||
|
@ -61,7 +61,8 @@ public class TaskScheduler : ITaskScheduler
|
|||||||
public const string ScanLibrariesTaskId = "scan-libraries";
|
public const string ScanLibrariesTaskId = "scan-libraries";
|
||||||
public const string ReportStatsTaskId = "report-stats";
|
public const string ReportStatsTaskId = "report-stats";
|
||||||
|
|
||||||
private static readonly ImmutableArray<string> ScanTasks = ImmutableArray.Create("ScannerService", "ScanLibrary", "ScanLibraries", "ScanFolder", "ScanSeries");
|
private static readonly ImmutableArray<string> ScanTasks =
|
||||||
|
ImmutableArray.Create("ScannerService", "ScanLibrary", "ScanLibraries", "ScanFolder", "ScanSeries");
|
||||||
|
|
||||||
private static readonly Random Rnd = new Random();
|
private static readonly Random Rnd = new Random();
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
"TokenKey": "super secret unguessable key",
|
"TokenKey": "super secret unguessable key",
|
||||||
"Port": 5000,
|
"Port": 5000,
|
||||||
"IpAddresses": "",
|
"IpAddresses": "",
|
||||||
"BaseUrl": "/"
|
"BaseUrl": "/test/"
|
||||||
}
|
}
|
@ -4,16 +4,18 @@ export enum AgeRating {
|
|||||||
*/
|
*/
|
||||||
NotApplicable = -1,
|
NotApplicable = -1,
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
AdultsOnly = 1,
|
RatingPending = 1,
|
||||||
EarlyChildhood = 2,
|
EarlyChildhood = 2,
|
||||||
Everyone = 3,
|
Everyone = 3,
|
||||||
Everyone10Plus = 4,
|
G = 4,
|
||||||
G = 5,
|
Everyone10Plus = 5,
|
||||||
KidsToAdults = 6,
|
PG = 6,
|
||||||
Mature = 7,
|
KidsToAdults = 7,
|
||||||
Mature15Plus = 8,
|
Teen = 8,
|
||||||
Mature17Plus = 9,
|
Mature15Plus = 9,
|
||||||
RatingPending = 10,
|
Mature17Plus = 10,
|
||||||
Teen = 11,
|
Mature = 11,
|
||||||
X18Plus = 12
|
R18Plus = 12,
|
||||||
|
AdultsOnly = 13,
|
||||||
|
X18Plus = 14
|
||||||
}
|
}
|
@ -59,6 +59,7 @@ export class InviteUserComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}, err => {
|
}, err => {
|
||||||
this.isSending = false;
|
this.isSending = false;
|
||||||
|
this.toastr.error(err)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ export class AgeRatingPipe implements PipeTransform {
|
|||||||
case AgeRating.Teen: return of('Teen');
|
case AgeRating.Teen: return of('Teen');
|
||||||
case AgeRating.X18Plus: return of('X18+');
|
case AgeRating.X18Plus: return of('X18+');
|
||||||
case AgeRating.NotApplicable: return of('Not Applicable');
|
case AgeRating.NotApplicable: return of('Not Applicable');
|
||||||
|
case AgeRating.PG: return of('PG');
|
||||||
|
case AgeRating.R18Plus: return of('R18+')
|
||||||
}
|
}
|
||||||
|
|
||||||
return of('Unknown');
|
return of('Unknown');
|
||||||
|
@ -257,10 +257,10 @@ export class UserPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
transformKeyToOpdsUrl(key: string) {
|
transformKeyToOpdsUrl(key: string) {
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
return `${location.origin}${environment.apiUrl}opds/${key}`;
|
return `${location.origin}${environment.apiUrl}opds/${key}`.replace('//', '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${location.origin}${this.baseUrl}api/opds/${key}`;
|
return `${location.origin}${this.baseUrl}api/opds/${key}`.replace('//', '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
handleBackgroundColorChange() {
|
handleBackgroundColorChange() {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"name": "GPL-3.0",
|
"name": "GPL-3.0",
|
||||||
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
|
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
|
||||||
},
|
},
|
||||||
"version": "0.7.1.36"
|
"version": "0.7.1.37"
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
@ -14537,6 +14537,7 @@
|
|||||||
"includeInRecommended",
|
"includeInRecommended",
|
||||||
"includeInSearch",
|
"includeInSearch",
|
||||||
"manageCollections",
|
"manageCollections",
|
||||||
|
"manageReadingLists",
|
||||||
"name",
|
"name",
|
||||||
"type"
|
"type"
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user