Website services organized
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model;
|
||||
using WatchIt.Common.Model.Rating;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
|
||||
namespace WatchIt.Website.Components.Common.Subcomponents;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Genders;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Genders;
|
||||
using WatchIt.Website.Services.Client.Genders;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.DatabasePage.Subcomponents;
|
||||
|
||||
@@ -9,7 +9,7 @@ public partial class PersonsFilterFormComponent : FilterFormComponent<PersonResp
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IGendersWebAPIService GendersWebAPIService { get; set; } = default!;
|
||||
[Inject] private IGendersClientService GendersClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -34,7 +34,7 @@ public partial class PersonsFilterFormComponent : FilterFormComponent<PersonResp
|
||||
// STEP 0
|
||||
endTasks.AddRange(
|
||||
[
|
||||
GendersWebAPIService.GetAllGenders(successAction: data => _genders = data)
|
||||
GendersClientService.GetAllGenders(successAction: data => _genders = data)
|
||||
]);
|
||||
|
||||
// END
|
||||
|
||||
@@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.MediaEditPage.Panels;
|
||||
|
||||
@@ -12,9 +12,9 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -62,8 +62,8 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.GetMediaAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesWebAPIService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
MediaClientService.GetMediaAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesClientService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -120,11 +120,11 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase
|
||||
_saving = true;
|
||||
if (_editedId.HasValue)
|
||||
{
|
||||
await RolesWebAPIService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
await RolesClientService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
}
|
||||
else
|
||||
{
|
||||
await MediaWebAPIService.PostMediaActorRole(Id!.Value, _editedModel as ActorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
await MediaClientService.PostMediaActorRole(Id!.Value, _editedModel as ActorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase
|
||||
private async Task Delete(Guid id)
|
||||
{
|
||||
_roles[id] = (_roles[id].Data, true);
|
||||
await RolesWebAPIService.DeleteActorRole(id, () => _roles.Remove(id));
|
||||
await RolesClientService.DeleteActorRole(id, () => _roles.Remove(id));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.MediaEditPage.Panels;
|
||||
|
||||
@@ -12,9 +12,9 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -62,8 +62,8 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.GetMediaAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
MediaClientService.GetMediaAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -119,11 +119,11 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase
|
||||
_saving = true;
|
||||
if (_editedId.HasValue)
|
||||
{
|
||||
await RolesWebAPIService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
await RolesClientService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
}
|
||||
else
|
||||
{
|
||||
await MediaWebAPIService.PostMediaCreatorRole(Id!.Value, _editedModel as CreatorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
await MediaClientService.PostMediaCreatorRole(Id!.Value, _editedModel as CreatorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase
|
||||
private async Task Delete(Guid id)
|
||||
{
|
||||
_roles[id] = (_roles[id].Data, true);
|
||||
await RolesWebAPIService.DeleteCreatorRole(id, () => _roles.Remove(id));
|
||||
await RolesClientService.DeleteCreatorRole(id, () => _roles.Remove(id));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
TQuery="ActorRoleMediaQueryParameters"
|
||||
TRoleParent="PersonResponse"
|
||||
Id="@(Id)"
|
||||
GetRolesAction="@(MediaWebAPIService.GetMediaAllActorRoles)"
|
||||
GetRolesAction="@(MediaClientService.GetMediaAllActorRoles)"
|
||||
NameSource="@((_, parent) => parent.Name)"
|
||||
AdditionalInfoSource="@((item, _) => $" as {item.Name}")"
|
||||
GetRoleParentMethod="@((id, action) => PersonsWebAPIService.GetPerson(id, action))"
|
||||
GetRoleParentMethod="@((id, action) => PersonsClientService.GetPerson(id, action))"
|
||||
ParentItemIdSource="@(item => item.PersonId)"
|
||||
ParentUrlTemplate="/person/{0}"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
PosterDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetActorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesWebAPIService.PutActorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@(id => RolesWebAPIService.DeleteActorRoleRating(id))"/>
|
||||
PosterDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesClientService.GetActorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesClientService.PutActorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@(id => RolesClientService.DeleteActorRoleRating(id))"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,8 +1,8 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.MediaPage.Panels;
|
||||
|
||||
@@ -10,9 +10,9 @@ public partial class MediaActorRolesPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@
|
||||
TRoleParent="PersonResponse"
|
||||
Id="@(Id)"
|
||||
Query="@(_query)"
|
||||
GetRolesAction="@(MediaWebAPIService.GetMediaAllCreatorRoles)"
|
||||
GetRolesAction="@(MediaClientService.GetMediaAllCreatorRoles)"
|
||||
NameSource="@((_, parent) => parent.Name)"
|
||||
GetRoleParentMethod="@((id, action) => PersonsWebAPIService.GetPerson(id, action))"
|
||||
GetRoleParentMethod="@((id, action) => PersonsClientService.GetPerson(id, action))"
|
||||
ParentItemIdSource="@(item => item.PersonId)"
|
||||
ParentUrlTemplate="/person/{0}"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
PosterDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetCreatorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesWebAPIService.PutCreatorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@((id) => RolesWebAPIService.DeleteCreatorRoleRating(id))"/>
|
||||
PosterDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesClientService.GetCreatorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesClientService.PutCreatorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@((id) => RolesClientService.DeleteCreatorRoleRating(id))"/>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2,10 +2,10 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Components.Common.Subcomponents;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.MediaPage.Panels;
|
||||
|
||||
@@ -13,9 +13,9 @@ public partial class MediaCreatorRolesPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -54,7 +54,7 @@ public partial class MediaCreatorRolesPanelComponent : ComponentBase
|
||||
// STEP 0
|
||||
endTasks.AddRange(
|
||||
[
|
||||
RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data)
|
||||
RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data)
|
||||
]);
|
||||
|
||||
// END
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels;
|
||||
|
||||
@@ -11,9 +11,9 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -61,8 +61,8 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetPersonAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesWebAPIService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
PersonsClientService.GetPersonAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesClientService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -122,11 +122,11 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase
|
||||
_saving = true;
|
||||
if (_editedId.HasValue)
|
||||
{
|
||||
await RolesWebAPIService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
await RolesClientService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
}
|
||||
else
|
||||
{
|
||||
await PersonsWebAPIService.PostPersonActorRole(Id!.Value, _editedModel as ActorRolePersonRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
await PersonsClientService.PostPersonActorRole(Id!.Value, _editedModel as ActorRolePersonRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase
|
||||
private async Task Delete(Guid id)
|
||||
{
|
||||
_roles[id] = (_roles[id].Data, true);
|
||||
await RolesWebAPIService.DeleteActorRole(id, () => _roles.Remove(id));
|
||||
await RolesClientService.DeleteActorRole(id, () => _roles.Remove(id));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels;
|
||||
|
||||
@@ -11,9 +11,9 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -61,8 +61,8 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetPersonAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
PersonsClientService.GetPersonAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))),
|
||||
RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase
|
||||
_saving = true;
|
||||
if (_editedId.HasValue)
|
||||
{
|
||||
await RolesWebAPIService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
await RolesClientService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized);
|
||||
}
|
||||
else
|
||||
{
|
||||
await PersonsWebAPIService.PostPersonCreatorRole(Id!.Value, _editedModel as CreatorRolePersonRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
await PersonsClientService.PostPersonCreatorRole(Id!.Value, _editedModel as CreatorRolePersonRequest, SuccessPost, BadRequest, Unauthorized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase
|
||||
private async Task Delete(Guid id)
|
||||
{
|
||||
_roles[id] = (_roles[id].Data, true);
|
||||
await RolesWebAPIService.DeleteCreatorRole(id, () => _roles.Remove(id));
|
||||
await RolesClientService.DeleteCreatorRole(id, () => _roles.Remove(id));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Genders;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Genders;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.Client.Genders;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels;
|
||||
|
||||
@@ -11,8 +11,8 @@ public partial class PersonEditFormPanelComponent : ComponentBase
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IGendersWebAPIService GendersWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IGendersClientService GendersClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -52,13 +52,13 @@ public partial class PersonEditFormPanelComponent : ComponentBase
|
||||
// STEP 0
|
||||
endTasks.AddRange(
|
||||
[
|
||||
GendersWebAPIService.GetAllGenders(successAction: data => _genders = data)
|
||||
GendersClientService.GetAllGenders(successAction: data => _genders = data)
|
||||
]);
|
||||
if (Id.HasValue)
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetPerson(Id.Value, data => _person = new PersonRequest(data))
|
||||
PersonsClientService.GetPerson(Id.Value, data => _person = new PersonRequest(data))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ public partial class PersonEditFormPanelComponent : ComponentBase
|
||||
_saving = true;
|
||||
if (Id.HasValue)
|
||||
{
|
||||
await PersonsWebAPIService.PutPerson(Id.Value, _person, PutSuccess, BadRequest, AuthError, AuthError);
|
||||
await PersonsClientService.PutPerson(Id.Value, _person, PutSuccess, BadRequest, AuthError, AuthError);
|
||||
}
|
||||
else
|
||||
{
|
||||
await PersonsWebAPIService.PostPerson(_person, PostSuccess, BadRequest, AuthError, AuthError);
|
||||
await PersonsClientService.PostPerson(_person, PostSuccess, BadRequest, AuthError, AuthError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,18 +10,18 @@
|
||||
TQuery="ActorRolePersonQueryParameters"
|
||||
TRoleParent="MediaResponse"
|
||||
Id="@(Id)"
|
||||
GetRolesAction="@(PersonsWebAPIService.GetPersonAllActorRoles)"
|
||||
GetRolesAction="@(PersonsClientService.GetPersonAllActorRoles)"
|
||||
NameSource="@((_, parent) => parent.Title)"
|
||||
AdditionalInfoSource="@((item, _) => $" as {item.Name}")"
|
||||
GetRoleParentMethod="@((id, action) => MediaWebAPIService.GetMedia(id, action))"
|
||||
GetRoleParentMethod="@((id, action) => MediaClientService.GetMedia(id, action))"
|
||||
ParentItemIdSource="@(item => item.MediaId)"
|
||||
ParentUrlTemplate="/media/{0}"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
PosterDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetActorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesWebAPIService.PutActorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@(id => RolesWebAPIService.DeleteActorRoleRating(id))"
|
||||
PosterDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesClientService.GetActorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesClientService.PutActorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@(id => RolesClientService.DeleteActorRoleRating(id))"
|
||||
OnRatingChanged="@(OnRatingChanged)"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonPage.Panels;
|
||||
|
||||
@@ -9,9 +9,9 @@ public partial class PersonActorRolesPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@
|
||||
TRoleParent="MediaResponse"
|
||||
Id="@(Id)"
|
||||
Query="@(_query)"
|
||||
GetRolesAction="@(PersonsWebAPIService.GetPersonAllCreatorRoles)"
|
||||
GetRolesAction="@(PersonsClientService.GetPersonAllCreatorRoles)"
|
||||
NameSource="@((_, parent) => parent.Title)"
|
||||
GetRoleParentMethod="@((id, action) => MediaWebAPIService.GetMedia(id, action))"
|
||||
GetRoleParentMethod="@((id, action) => MediaClientService.GetMedia(id, action))"
|
||||
ParentItemIdSource="@(item => item.MediaId)"
|
||||
ParentUrlTemplate="/media/{0}"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
PosterDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetCreatorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesWebAPIService.PutCreatorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@((id) => RolesWebAPIService.DeleteCreatorRoleRating(id))"
|
||||
PosterDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
GetGlobalRatingMethod="@((id, action) => RolesClientService.GetCreatorRoleRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
|
||||
PutRatingMethod="@((id, request) => RolesClientService.PutCreatorRoleRating(id, request))"
|
||||
DeleteRatingMethod="@((id) => RolesClientService.DeleteCreatorRoleRating(id))"
|
||||
OnRatingChanged="@(OnRatingChanged)"/>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.Website.Components.Common.Subcomponents;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonPage.Panels;
|
||||
|
||||
@@ -12,9 +12,9 @@ public partial class PersonCreatorRolesPanelComponent : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IRolesClientService RolesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -54,7 +54,7 @@ public partial class PersonCreatorRolesPanelComponent : ComponentBase
|
||||
// STEP 0
|
||||
endTasks.AddRange(
|
||||
[
|
||||
RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data)
|
||||
RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data)
|
||||
]);
|
||||
|
||||
// END
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Rating;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
|
||||
namespace WatchIt.Website.Components.Pages.PersonPage.Panels;
|
||||
|
||||
@@ -10,7 +10,7 @@ public partial class PersonRatingPanel : ComponentBase
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -83,13 +83,13 @@ public partial class PersonRatingPanel : ComponentBase
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateGlobalRating() => await PersonsWebAPIService.GetPersonGlobalRating(Id, data => Rating = data);
|
||||
protected async Task UpdateGlobalRating() => await PersonsClientService.GetPersonGlobalRating(Id, data => Rating = data);
|
||||
|
||||
protected async Task UpdateUserRating()
|
||||
{
|
||||
if (_user is not null)
|
||||
{
|
||||
await PersonsWebAPIService.GetPersonUserRating(Id, _user.Id, data => _userRating = data);
|
||||
await PersonsClientService.GetPersonUserRating(Id, _user.Id, data => _userRating = data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@using System.Net
|
||||
@using WatchIt.Common.Model.Photos
|
||||
@using WatchIt.Website.Services.WebAPI.Photos
|
||||
@using WatchIt.Website.Services.Client.Photos
|
||||
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ using System.Net;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Accounts;
|
||||
using WatchIt.Common.Model.Photos;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.Utility.Tokens;
|
||||
using WatchIt.Website.Services.WebAPI.Accounts;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Photos;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Tokens;
|
||||
using WatchIt.Website.Services.Client.Accounts;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Photos;
|
||||
|
||||
namespace WatchIt.Website.Layout;
|
||||
|
||||
@@ -18,9 +18,9 @@ public partial class MainLayout : LayoutComponentBase
|
||||
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] public ITokensService TokensService { get; set; } = default!;
|
||||
[Inject] public IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!;
|
||||
[Inject] public IAccountsClientService AccountsClientService { get; set; } = default!;
|
||||
[Inject] public IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] public IPhotosClientService PhotosClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -76,7 +76,7 @@ public partial class MainLayout : LayoutComponentBase
|
||||
]);
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PhotosWebAPIService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data)
|
||||
PhotosClientService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data)
|
||||
]);
|
||||
|
||||
// STEP 1
|
||||
@@ -85,7 +85,7 @@ public partial class MainLayout : LayoutComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
AccountsWebAPIService.GetAccountProfilePicture(_user.Id, data => _userProfilePicture = data)
|
||||
AccountsClientService.GetAccountProfilePicture(_user.Id, data => _userProfilePicture = data)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -3,11 +3,11 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Accounts;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Photos;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.Utility.Tokens;
|
||||
using WatchIt.Website.Services.WebAPI.Accounts;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Photos;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Tokens;
|
||||
using WatchIt.Website.Services.Client.Accounts;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Photos;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -18,9 +18,9 @@ public partial class AuthPage
|
||||
[Inject] public ILogger<AuthPage> Logger { get; set; } = default!;
|
||||
[Inject] public IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] public ITokensService TokensService { get; set; } = default!;
|
||||
[Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!;
|
||||
[Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] public IAccountsClientService AccountsClientService { get; set; } = default!;
|
||||
[Inject] public IPhotosClientService PhotosClientService { get; set; } = default!;
|
||||
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
@@ -80,7 +80,7 @@ public partial class AuthPage
|
||||
// STEP 0
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PhotosWebAPIService.GetPhotoRandomBackground(data => _background = data)
|
||||
PhotosClientService.GetPhotoRandomBackground(data => _background = data)
|
||||
]);
|
||||
|
||||
// END
|
||||
@@ -112,7 +112,7 @@ public partial class AuthPage
|
||||
}
|
||||
|
||||
|
||||
await AccountsWebAPIService.Authenticate(_loginModel, async (data) => await LoginSuccess(data), LoginBadRequest, LoginUnauthorized);
|
||||
await AccountsClientService.Authenticate(_loginModel, async (data) => await LoginSuccess(data), LoginBadRequest, LoginUnauthorized);
|
||||
}
|
||||
|
||||
private async Task Register()
|
||||
@@ -137,7 +137,7 @@ public partial class AuthPage
|
||||
_formMessage = "Password fields don't match";
|
||||
return;
|
||||
}
|
||||
await AccountsWebAPIService.Register(_registerModel, RegisterSuccess, RegisterBadRequest);
|
||||
await AccountsClientService.Register(_registerModel, RegisterSuccess, RegisterBadRequest);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
UrlIdTemplate="/media/{0}"
|
||||
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(MoviesWebAPIService.GetAllMovies)"
|
||||
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(MoviesClientService.GetAllMovies)"
|
||||
SortingOptions="@(new Dictionary<string, string>
|
||||
{
|
||||
{ "rating.count", "Number of ratings" },
|
||||
@@ -48,10 +48,10 @@
|
||||
{ "release_date", "Release date" },
|
||||
})"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => MediaWebAPIService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaWebAPIService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaWebAPIService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaWebAPIService.DeleteMediaRating(id))">
|
||||
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))">
|
||||
<MoviesFilterFormComponent/>
|
||||
</DatabasePageComponent>
|
||||
break;
|
||||
@@ -64,8 +64,8 @@
|
||||
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
UrlIdTemplate="/media/{0}"
|
||||
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(SeriesWebAPIService.GetAllSeries)"
|
||||
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(SeriesClientService.GetAllSeries)"
|
||||
SortingOptions="@(new Dictionary<string, string>
|
||||
{
|
||||
{ "rating.count", "Number of ratings" },
|
||||
@@ -74,10 +74,10 @@
|
||||
{ "release_date", "Release date" },
|
||||
})"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => MediaWebAPIService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaWebAPIService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaWebAPIService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaWebAPIService.DeleteMediaRating(id))">
|
||||
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))">
|
||||
<SeriesFilterFormComponent/>
|
||||
</DatabasePageComponent>
|
||||
break;
|
||||
@@ -89,8 +89,8 @@
|
||||
NameSource="@(item => item.Name)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
UrlIdTemplate="/person/{0}"
|
||||
PictureDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
|
||||
ItemDownloadingTask="@(PersonsWebAPIService.GetAllPersons)"
|
||||
PictureDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"
|
||||
ItemDownloadingTask="@(PersonsClientService.GetAllPersons)"
|
||||
SortingOptions="@(new Dictionary<string, string>
|
||||
{
|
||||
{ "rating.count", "Number of ratings" },
|
||||
@@ -100,7 +100,7 @@
|
||||
{ "death_date", "Death date" },
|
||||
})"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => PersonsWebAPIService.GetPersonGlobalRating(id, action))">
|
||||
GetGlobalRatingMethod="@((id, action) => PersonsClientService.GetPersonGlobalRating(id, action))">
|
||||
<PersonsFilterFormComponent/>
|
||||
</DatabasePageComponent>
|
||||
break;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -12,10 +12,10 @@ public partial class DatabasePage : ComponentBase
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
|
||||
[Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IMoviesClientService MoviesClientService { get; set; } = default!;
|
||||
[Inject] private ISeriesClientService SeriesClientService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -12,26 +12,26 @@
|
||||
<div class="vstack gap-default">
|
||||
<ViewRankPanelComponent TItem="MovieResponse"
|
||||
Name="movies"
|
||||
GetViewRankAction="@((count, action) => MoviesWebAPIService.GetMoviesViewRank(count, successAction: action))"
|
||||
GetViewRankAction="@((count, action) => MoviesClientService.GetMoviesViewRank(count, successAction: action))"
|
||||
ItemUrlFormatString="/media/{0}"
|
||||
IdSource="@(item => item.Id)"
|
||||
NameSource="@(item => item.ReleaseDate.HasValue ? $"{item.Title} ({item.ReleaseDate.Value.Year})" : item.Title)"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetPictureAction="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"/>
|
||||
GetPictureAction="@((id, action) => MediaClientService.GetMediaPoster(id, action))"/>
|
||||
<ViewRankPanelComponent TItem="SeriesResponse"
|
||||
Name="TV series"
|
||||
GetViewRankAction="@((count, action) => SeriesWebAPIService.GetSeriesViewRank(count, successAction: action))"
|
||||
GetViewRankAction="@((count, action) => SeriesClientService.GetSeriesViewRank(count, successAction: action))"
|
||||
ItemUrlFormatString="/media/{0}"
|
||||
IdSource="@(item => item.Id)"
|
||||
NameSource="@(item => item.ReleaseDate.HasValue ? $"{item.Title} ({item.ReleaseDate.Value.Year})" : item.Title)"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetPictureAction="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"/>
|
||||
GetPictureAction="@((id, action) => MediaClientService.GetMediaPoster(id, action))"/>
|
||||
<ViewRankPanelComponent TItem="PersonResponse"
|
||||
Name="people"
|
||||
GetViewRankAction="@((count, action) => PersonsWebAPIService.GetPersonsViewRank(count, successAction: action))"
|
||||
GetViewRankAction="@((count, action) => PersonsClientService.GetPersonsViewRank(count, successAction: action))"
|
||||
ItemUrlFormatString="/person/{0}"
|
||||
IdSource="@(item => item.Id)"
|
||||
NameSource="@(item => item.Name)"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
GetPictureAction="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"/>
|
||||
GetPictureAction="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"/>
|
||||
</div>
|
||||
@@ -3,10 +3,10 @@ using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Movies;
|
||||
using WatchIt.Common.Model.Series;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -15,10 +15,10 @@ public partial class HomePage
|
||||
#region SERVICES
|
||||
|
||||
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
|
||||
[Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
|
||||
[Inject] public IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] public IMoviesClientService MoviesClientService { get; set; } = default!;
|
||||
[Inject] public ISeriesClientService SeriesClientService { get; set; } = default!;
|
||||
[Inject] public IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
<div class="row mt-3 gx-3">
|
||||
<div class="col-auto">
|
||||
<PictureEditorPanelComponent Id="@(Id)"
|
||||
PictureGetTask="@(async (id, action) => await MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
PicturePutTask="@(async (id, data, action) => await MediaWebAPIService.PutMediaPoster(id, new MediaPosterRequest(data), action))"
|
||||
PictureDeleteTask="@(async (id, action) => await MediaWebAPIService.DeleteMediaPoster(id, action))"
|
||||
PictureGetTask="@(async (id, action) => await MediaClientService.GetMediaPoster(id, action))"
|
||||
PicturePutTask="@(async (id, data, action) => await MediaClientService.PutMediaPoster(id, new MediaPosterRequest(data), action))"
|
||||
PictureDeleteTask="@(async (id, action) => await MediaClientService.DeleteMediaPoster(id, action))"
|
||||
PicturePlaceholder="/assets/media_poster.png"
|
||||
Class="h-100"/>
|
||||
</div>
|
||||
|
||||
@@ -7,12 +7,12 @@ using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Common.Model.Photos;
|
||||
using WatchIt.Common.Model.Series;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Photos;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Photos;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -22,11 +22,11 @@ public partial class MediaEditPage : ComponentBase
|
||||
|
||||
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] public IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
|
||||
[Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
|
||||
[Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!;
|
||||
[Inject] public IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] public IMoviesClientService MoviesClientService { get; set; } = default!;
|
||||
[Inject] public ISeriesClientService SeriesClientService { get; set; } = default!;
|
||||
[Inject] public IPhotosClientService PhotosClientService { get; set; } = default!;
|
||||
[Inject] public IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -114,7 +114,7 @@ public partial class MediaEditPage : ComponentBase
|
||||
]);
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetAllPersons(successAction: data => _persons = data.ToDictionary(x => x.Id, x => x))
|
||||
PersonsClientService.GetAllPersons(successAction: data => _persons = data.ToDictionary(x => x.Id, x => x))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ public partial class MediaEditPage : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.GetMediaPhotoRandomBackground(Id.Value, data => Layout.BackgroundPhoto = data),
|
||||
MediaWebAPIService.GetMediaPoster(Id.Value, data =>
|
||||
MediaClientService.GetMediaPhotoRandomBackground(Id.Value, data => Layout.BackgroundPhoto = data),
|
||||
MediaClientService.GetMediaPoster(Id.Value, data =>
|
||||
{
|
||||
_mediaPosterSaved = data;
|
||||
_mediaPosterRequest = new MediaPosterRequest(data);
|
||||
}),
|
||||
MediaWebAPIService.GetMediaPhotos(Id.Value, successAction: data => _photos = data)
|
||||
MediaClientService.GetMediaPhotos(Id.Value, successAction: data => _photos = data)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -145,14 +145,14 @@ public partial class MediaEditPage : ComponentBase
|
||||
{
|
||||
if (Id.HasValue)
|
||||
{
|
||||
await MediaWebAPIService.GetMedia(Id.Value, data => _media = data, () => NavigationManager.NavigateTo("/media/new/movie"));
|
||||
await MediaClientService.GetMedia(Id.Value, data => _media = data, () => NavigationManager.NavigateTo("/media/new/movie"));
|
||||
if (_media.Type == MediaType.Movie)
|
||||
{
|
||||
await MoviesWebAPIService.GetMovie(Id.Value, data => _movieRequest = new MovieRequest(data));
|
||||
await MoviesClientService.GetMovie(Id.Value, data => _movieRequest = new MovieRequest(data));
|
||||
}
|
||||
else
|
||||
{
|
||||
await SeriesWebAPIService.GetSeries(Id.Value, data => _seriesRequest = new SeriesRequest(data));
|
||||
await SeriesClientService.GetSeries(Id.Value, data => _seriesRequest = new SeriesRequest(data));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -210,7 +210,7 @@ public partial class MediaEditPage : ComponentBase
|
||||
}
|
||||
|
||||
_mediaPosterSaving = true;
|
||||
await MediaWebAPIService.PutMediaPoster(Id.Value, _mediaPosterRequest, Success);
|
||||
await MediaClientService.PutMediaPoster(Id.Value, _mediaPosterRequest, Success);
|
||||
}
|
||||
|
||||
private void CancelPoster()
|
||||
@@ -230,7 +230,7 @@ public partial class MediaEditPage : ComponentBase
|
||||
}
|
||||
|
||||
_mediaPosterDeleting = true;
|
||||
await MediaWebAPIService.DeleteMediaPoster(Id.Value, Success);
|
||||
await MediaClientService.DeleteMediaPoster(Id.Value, Success);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -259,22 +259,22 @@ public partial class MediaEditPage : ComponentBase
|
||||
{
|
||||
if (_movieRequest is not null)
|
||||
{
|
||||
await MoviesWebAPIService.PostMovie(_movieRequest, data => SuccessPost(data.Id), BadRequest);
|
||||
await MoviesClientService.PostMovie(_movieRequest, data => SuccessPost(data.Id), BadRequest);
|
||||
}
|
||||
else
|
||||
{
|
||||
await SeriesWebAPIService.PostSeries(_seriesRequest, data => SuccessPost(data.Id), BadRequest);
|
||||
await SeriesClientService.PostSeries(_seriesRequest, data => SuccessPost(data.Id), BadRequest);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_movieRequest is not null)
|
||||
{
|
||||
await MoviesWebAPIService.PutMovie(Id.Value, _movieRequest, () => _basicDataSaving = false, BadRequest);
|
||||
await MoviesClientService.PutMovie(Id.Value, _movieRequest, () => _basicDataSaving = false, BadRequest);
|
||||
}
|
||||
else
|
||||
{
|
||||
await SeriesWebAPIService.PutSeries(Id.Value, _seriesRequest, () => _basicDataSaving = false, BadRequest);
|
||||
await SeriesClientService.PutSeries(Id.Value, _seriesRequest, () => _basicDataSaving = false, BadRequest);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public partial class MediaEditPage : ComponentBase
|
||||
}
|
||||
|
||||
_photoDeleting.Add(id);
|
||||
await PhotosWebAPIService.DeletePhoto(id, async () => await Success());
|
||||
await PhotosClientService.DeletePhoto(id, async () => await Success());
|
||||
}
|
||||
|
||||
private void InitEditPhoto(Guid? id)
|
||||
@@ -345,17 +345,17 @@ public partial class MediaEditPage : ComponentBase
|
||||
if (_photoEditId is null)
|
||||
{
|
||||
_photoEditRequest.Background = _photoEditIsBackground ? _photoEditBackgroundData : null;
|
||||
await MediaWebAPIService.PostMediaPhoto(Id.Value, _photoEditRequest, Success, BadRequest);
|
||||
await MediaClientService.PostMediaPhoto(Id.Value, _photoEditRequest, Success, BadRequest);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_photoEditIsBackground)
|
||||
{
|
||||
await PhotosWebAPIService.PutPhotoBackgroundData(_photoEditId.Value, _photoEditBackgroundData, Success, BadRequest);
|
||||
await PhotosClientService.PutPhotoBackgroundData(_photoEditId.Value, _photoEditBackgroundData, Success, BadRequest);
|
||||
}
|
||||
else
|
||||
{
|
||||
await PhotosWebAPIService.DeletePhotoBackgroundData(_photoEditId.Value, Success);
|
||||
await PhotosClientService.DeletePhotoBackgroundData(_photoEditId.Value, Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ else
|
||||
Subname="@(_media.OriginalTitle)"
|
||||
Description="@(_media.Description)"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetPosterMethod="@(action => MediaWebAPIService.GetMediaPoster(_media.Id, action))"/>
|
||||
GetPosterMethod="@(action => MediaClientService.GetMediaPoster(_media.Id, action))"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3 gx-3">
|
||||
|
||||
@@ -7,10 +7,10 @@ using WatchIt.Common.Model.Photos;
|
||||
using WatchIt.Common.Model.Rating;
|
||||
using WatchIt.Common.Model.Series;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -20,9 +20,9 @@ public partial class MediaPage : ComponentBase
|
||||
|
||||
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] public IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
|
||||
[Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
|
||||
[Inject] public IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] public IMoviesClientService MoviesClientService { get; set; } = default!;
|
||||
[Inject] public ISeriesClientService SeriesClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -74,7 +74,7 @@ public partial class MediaPage : ComponentBase
|
||||
// STEP 0
|
||||
step1Tasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.GetMedia(Id, data => _media = data, () => _error = $"Media with id {Id} was not found")
|
||||
MediaClientService.GetMedia(Id, data => _media = data, () => _error = $"Media with id {Id} was not found")
|
||||
]);
|
||||
|
||||
// STEP 1
|
||||
@@ -88,11 +88,11 @@ public partial class MediaPage : ComponentBase
|
||||
|
||||
endTasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.PostMediaView(Id),
|
||||
MediaWebAPIService.GetMediaPhotoRandomBackground(Id, data => Layout.BackgroundPhoto = data),
|
||||
MediaWebAPIService.GetMediaGenres(Id, data => _genres = data),
|
||||
MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data),
|
||||
_media.Type == MediaType.Movie ? MoviesWebAPIService.GetMovie(Id, data => _movie = data) : SeriesWebAPIService.GetSeries(Id, data => _series = data),
|
||||
MediaClientService.PostMediaView(Id),
|
||||
MediaClientService.GetMediaPhotoRandomBackground(Id, data => Layout.BackgroundPhoto = data),
|
||||
MediaClientService.GetMediaGenres(Id, data => _genres = data),
|
||||
MediaClientService.GetMediaRating(Id, data => _globalRating = data),
|
||||
_media.Type == MediaType.Movie ? MoviesClientService.GetMovie(Id, data => _movie = data) : SeriesClientService.GetSeries(Id, data => _series = data),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public partial class MediaPage : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
MediaWebAPIService.GetMediaRatingByUser(Id, _user.Id, data => _userRating = data)
|
||||
MediaClientService.GetMediaRatingByUser(Id, _user.Id, data => _userRating = data)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -118,15 +118,15 @@ public partial class MediaPage : ComponentBase
|
||||
{
|
||||
if (_userRating == rating)
|
||||
{
|
||||
await MediaWebAPIService.DeleteMediaRating(Id);
|
||||
await MediaClientService.DeleteMediaRating(Id);
|
||||
_userRating = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
await MediaWebAPIService.PutMediaRating(Id, new RatingRequest(rating));
|
||||
await MediaClientService.PutMediaRating(Id, new RatingRequest(rating));
|
||||
_userRating = rating;
|
||||
}
|
||||
await MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data);
|
||||
await MediaClientService.GetMediaRating(Id, data => _globalRating = data);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
<div class="row mt-3 gx-3">
|
||||
<div class="col-auto">
|
||||
<PictureEditorPanelComponent Id="@(Id)"
|
||||
PictureGetTask="@(async (id, action) => await PersonsWebAPIService.GetPersonPhoto(id, action))"
|
||||
PicturePutTask="@(async (id, data, action) => await PersonsWebAPIService.PutPersonPhoto(id, new PersonPhotoRequest(data), action))"
|
||||
PictureDeleteTask="@(async (id, action) => await PersonsWebAPIService.DeletePersonPhoto(id, action))"
|
||||
PictureGetTask="@(async (id, action) => await PersonsClientService.GetPersonPhoto(id, action))"
|
||||
PicturePutTask="@(async (id, data, action) => await PersonsClientService.PutPersonPhoto(id, new PersonPhotoRequest(data), action))"
|
||||
PictureDeleteTask="@(async (id, action) => await PersonsClientService.DeletePersonPhoto(id, action))"
|
||||
PicturePlaceholder="/assets/person_poster.png"
|
||||
Class="h-100"/>
|
||||
</div>
|
||||
|
||||
@@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Media;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -14,8 +14,8 @@ public partial class PersonEditPage : ComponentBase
|
||||
|
||||
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
|
||||
[Inject] private IAuthenticationService AuthenticationService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -66,8 +66,8 @@ public partial class PersonEditPage : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetPerson(Id.Value, data => _person = data, () => NavigationManager.NavigateTo("/person/new", true)),
|
||||
MediaWebAPIService.GetAllMedia(successAction: data => _media = data.ToDictionary(x => x.Id, x => x)),
|
||||
PersonsClientService.GetPerson(Id.Value, data => _person = data, () => NavigationManager.NavigateTo("/person/new", true)),
|
||||
MediaClientService.GetAllMedia(successAction: data => _media = data.ToDictionary(x => x.Id, x => x)),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
Subname="@(_person.FullName)"
|
||||
Description="@(_person.Description)"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
GetPosterMethod="@(action => PersonsWebAPIService.GetPersonPhoto(_person.Id, action))"/>
|
||||
GetPosterMethod="@(action => PersonsClientService.GetPersonPhoto(_person.Id, action))"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-default gx-default">
|
||||
|
||||
@@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Common.Model.Persons;
|
||||
using WatchIt.Website.Components.Pages.PersonPage.Panels;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -10,7 +10,7 @@ public partial class PersonPage : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -53,7 +53,7 @@ public partial class PersonPage : ComponentBase
|
||||
// STEP 0
|
||||
step1Tasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.GetPerson(Id, data => _person = data)
|
||||
PersonsClientService.GetPerson(Id, data => _person = data)
|
||||
]);
|
||||
|
||||
// STEP 1
|
||||
@@ -62,7 +62,7 @@ public partial class PersonPage : ComponentBase
|
||||
{
|
||||
endTasks.AddRange(
|
||||
[
|
||||
PersonsWebAPIService.PostPersonView(Id),
|
||||
PersonsClientService.PostPersonView(Id),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
Query="@(new MovieQueryParameters { Title = DecodedQuery, OrderBy = "rating.count" })"
|
||||
ItemDownloadingTask="@(MoviesWebAPIService.GetAllMovies)"
|
||||
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(MoviesClientService.GetAllMovies)"
|
||||
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => MediaWebAPIService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaWebAPIService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaWebAPIService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaWebAPIService.DeleteMediaRating(id))"/>
|
||||
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))"/>
|
||||
<SearchResultPanelComponent TItem="SeriesResponse"
|
||||
TQuery="SeriesQueryParameters"
|
||||
Title="TV series"
|
||||
@@ -44,13 +44,13 @@
|
||||
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
Query="@(new SeriesQueryParameters { Title = DecodedQuery, OrderBy = "rating.count" })"
|
||||
ItemDownloadingTask="@(SeriesWebAPIService.GetAllSeries)"
|
||||
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
||||
ItemDownloadingTask="@(SeriesClientService.GetAllSeries)"
|
||||
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
||||
PosterPlaceholder="/assets/media_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => MediaWebAPIService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaWebAPIService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaWebAPIService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaWebAPIService.DeleteMediaRating(id))"/>
|
||||
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
||||
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
||||
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
||||
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))"/>
|
||||
<SearchResultPanelComponent TItem="PersonResponse"
|
||||
TQuery="PersonQueryParameters"
|
||||
Title="People"
|
||||
@@ -59,8 +59,8 @@
|
||||
NameSource="@(item => item.Name)"
|
||||
RatingSource="@(item => item.Rating)"
|
||||
Query="@(new PersonQueryParameters { Name = DecodedQuery, OrderBy = "rating.count" })"
|
||||
ItemDownloadingTask="@(PersonsWebAPIService.GetAllPersons)"
|
||||
PictureDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
|
||||
ItemDownloadingTask="@(PersonsClientService.GetAllPersons)"
|
||||
PictureDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"
|
||||
PosterPlaceholder="/assets/person_poster.png"
|
||||
GetGlobalRatingMethod="@((id, action) => PersonsWebAPIService.GetPersonGlobalRating(id, action))"/>
|
||||
GetGlobalRatingMethod="@((id, action) => PersonsClientService.GetPersonGlobalRating(id, action))"/>
|
||||
</div>
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Net;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WatchIt.Website.Layout;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
@@ -12,10 +12,10 @@ public partial class SearchPage : ComponentBase
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
[Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
|
||||
[Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
|
||||
[Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
|
||||
[Inject] private IMoviesClientService MoviesClientService { get; set; } = default!;
|
||||
[Inject] private ISeriesClientService SeriesClientService { get; set; } = default!;
|
||||
[Inject] private IMediaClientService MediaClientService { get; set; } = default!;
|
||||
[Inject] private IPersonsClientService PersonsClientService { get; set; } = default!;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
1
WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor
Normal file
1
WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor
Normal file
@@ -0,0 +1 @@
|
||||
@page "/user/edit"
|
||||
@@ -0,0 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
public partial class UserEditPage : ComponentBase
|
||||
{
|
||||
}
|
||||
1
WatchIt.Website/WatchIt.Website/Pages/UserPage.razor
Normal file
1
WatchIt.Website/WatchIt.Website/Pages/UserPage.razor
Normal file
@@ -0,0 +1 @@
|
||||
@page "/user/{id:long}"
|
||||
7
WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs
Normal file
7
WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace WatchIt.Website.Pages;
|
||||
|
||||
public partial class UserPage : ComponentBase
|
||||
{
|
||||
}
|
||||
@@ -5,17 +5,17 @@ using Blazorise.Bootstrap5;
|
||||
using Blazorise.Icons.FontAwesome;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using WatchIt.Common.Services.HttpClient;
|
||||
using WatchIt.Website.Services.Utility.Authentication;
|
||||
using WatchIt.Website.Services.Utility.Configuration;
|
||||
using WatchIt.Website.Services.Utility.Tokens;
|
||||
using WatchIt.Website.Services.WebAPI.Accounts;
|
||||
using WatchIt.Website.Services.WebAPI.Genders;
|
||||
using WatchIt.Website.Services.WebAPI.Media;
|
||||
using WatchIt.Website.Services.WebAPI.Movies;
|
||||
using WatchIt.Website.Services.WebAPI.Persons;
|
||||
using WatchIt.Website.Services.WebAPI.Photos;
|
||||
using WatchIt.Website.Services.WebAPI.Roles;
|
||||
using WatchIt.Website.Services.WebAPI.Series;
|
||||
using WatchIt.Website.Services.Authentication;
|
||||
using WatchIt.Website.Services.Configuration;
|
||||
using WatchIt.Website.Services.Tokens;
|
||||
using WatchIt.Website.Services.Client.Accounts;
|
||||
using WatchIt.Website.Services.Client.Genders;
|
||||
using WatchIt.Website.Services.Client.Media;
|
||||
using WatchIt.Website.Services.Client.Movies;
|
||||
using WatchIt.Website.Services.Client.Persons;
|
||||
using WatchIt.Website.Services.Client.Photos;
|
||||
using WatchIt.Website.Services.Client.Roles;
|
||||
using WatchIt.Website.Services.Client.Series;
|
||||
|
||||
namespace WatchIt.Website;
|
||||
|
||||
@@ -73,14 +73,14 @@ public static class Program
|
||||
builder.Services.AddScoped<IAuthenticationService, AuthenticationService>();
|
||||
|
||||
// WebAPI
|
||||
builder.Services.AddScoped<IAccountsWebAPIService, AccountsWebAPIService>();
|
||||
builder.Services.AddSingleton<IGendersWebAPIService, GendersWebAPIService>();
|
||||
builder.Services.AddSingleton<IMediaWebAPIService, MediaWebAPIService>();
|
||||
builder.Services.AddSingleton<IMoviesWebAPIService, MoviesWebAPIService>();
|
||||
builder.Services.AddSingleton<ISeriesWebAPIService, SeriesWebAPIService>();
|
||||
builder.Services.AddSingleton<IPhotosWebAPIService, PhotosWebAPIService>();
|
||||
builder.Services.AddSingleton<IPersonsWebAPIService, PersonsWebAPIService>();
|
||||
builder.Services.AddSingleton<IRolesWebAPIService, RolesWebAPIService>();
|
||||
builder.Services.AddScoped<IAccountsClientService, AccountsClientService>();
|
||||
builder.Services.AddSingleton<IGendersClientService, GendersClientService>();
|
||||
builder.Services.AddSingleton<IMediaClientService, MediaClientService>();
|
||||
builder.Services.AddSingleton<IMoviesClientService, MoviesClientService>();
|
||||
builder.Services.AddSingleton<ISeriesClientService, SeriesClientService>();
|
||||
builder.Services.AddSingleton<IPhotosClientService, PhotosClientService>();
|
||||
builder.Services.AddSingleton<IPersonsClientService, PersonsClientService>();
|
||||
builder.Services.AddSingleton<IRolesClientService, RolesClientService>();
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@@ -16,17 +16,8 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\WatchIt.Common\WatchIt.Common.Services\WatchIt.Common.Services.HttpClient\WatchIt.Common.Services.HttpClient.csproj" />
|
||||
<ProjectReference Include="..\..\WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Tokens\WatchIt.WebAPI.Services.Utility.Tokens.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Authentication\WatchIt.Website.Services.Utility.Authentication.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Configuration\WatchIt.Website.Services.Utility.Configuration.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Tokens\WatchIt.Website.Services.Utility.Tokens.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Accounts\WatchIt.Website.Services.WebAPI.Accounts.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Genders\WatchIt.Website.Services.WebAPI.Genders.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Media\WatchIt.Website.Services.WebAPI.Media.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Movies\WatchIt.Website.Services.WebAPI.Movies.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Persons\WatchIt.Website.Services.WebAPI.Persons.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Photos\WatchIt.Website.Services.WebAPI.Photos.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Roles\WatchIt.Website.Services.WebAPI.Roles.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Series\WatchIt.Website.Services.WebAPI.Series.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.Authentication\WatchIt.Website.Services.Authentication.csproj" />
|
||||
<ProjectReference Include="..\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Configuration\WatchIt.Website.Services.Configuration.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
@using WatchIt.Website.Components.Common.Panels
|
||||
@using WatchIt.Common.Model.Accounts
|
||||
@using WatchIt.Common.Model.Media
|
||||
@using WatchIt.Website.Services.Utility.Tokens
|
||||
@using WatchIt.Website.Services.Utility.Authentication
|
||||
@using WatchIt.Website.Services.WebAPI.Accounts
|
||||
@using WatchIt.Website.Services.WebAPI.Media
|
||||
@using WatchIt.Website.Services.Tokens
|
||||
@using WatchIt.Website.Services.Authentication
|
||||
@using WatchIt.Website.Services.Client.Accounts
|
||||
@using WatchIt.Website.Services.Client.Media
|
||||
@using Blazorise
|
||||
@using Blazorise.Bootstrap5
|
||||
Reference in New Issue
Block a user