using Microsoft.AspNetCore.Http; using RMuseum.Models.GanjoorAudio; using RMuseum.Models.GanjoorAudio.ViewModels; using RMuseum.Models.UploadSession; using RMuseum.Models.UploadSession.ViewModels; using RSecurityBackend.Models.Generic; using System; using System.Threading.Tasks; namespace RMuseum.Services { /// /// Audio Narration Service /// public interface IRecitationService { /// /// returns list of narrations /// /// /// send Guid.Empty if you want all narrations /// /// /// /// /// public Task> SecureGetAll(PagingParameterModel paging, Guid filteredUserId, AudioReviewStatus status, string searchTerm, bool mistakes, RecitationType recitationType); /// /// returns list of publish narrations (if poetId or catId is non-zero its ordered by poemId ascending if not it is ordered by publish date descending) /// /// /// /// /// /// Task> GetPublishedRecitations(PagingParameterModel paging, string searchTerm = "", int poetId = 0, int catId = 0); /// /// get category top recitations /// /// /// /// Task> GetPoemCategoryTopRecitations(int catId, bool includePoemText); /// /// check if a category has any recitations /// /// /// Task> GetPoemCategoryHasAnyRecitations(int catId); /// /// get published recitation by id /// /// /// Task> GetPublishedRecitationById(int id); /// /// return selected narration information /// /// /// Task> Get(int id); /// /// Delete recitation (recitation should belong to userId) /// /// /// /// Task> Delete(int id, Guid userId); /// /// Replace only the synchronization (xml) file of an existing, approved recitation owned by the /// user. The recitation's mp3 file is left untouched; the uploaded xml's embedded PoemId and audio /// checksum must match the target recitation or the request is rejected. On success, the updated /// xml is re-published to the external/backup FTP servers in the background and the user is /// notified of the final result (success or failure). /// /// must be the recitation owner /// /// /// Task> ReplaceRecitationSyncXmlFile(Guid userId, int recitationId, IFormFile xmlFile); /// /// Gets Verse Sync Range Information /// /// narration id /// Task> GetPoemNarrationVerseSyncArray(int id); /// /// updates metadata for narration /// /// /// /// Task> UpdatePoemNarration(int id, RecitationViewModel metadata); /// /// build profiles from exisng narrations data /// /// User Id which becomes owner of imported data /// error string if occurs Task BuildProfilesFromExistingData(Guid ownerRAppUserId); /// /// Initiate New Upload Session for audio /// /// /// /// Task> InitiateNewUploadSession(Guid userId, bool replace); /// /// Save uploaded file /// /// /// Task> SaveUploadedFile(IFormFile uploadedFile); /// /// finalize upload session (add files) /// /// /// /// /// Task> FinalizeNewUploadSession(UploadSession session, RecitationType recitationType, UploadSessionFile[] files); /// /// Moderate pending narration /// /// /// /// /// Task> ModeratePoemNarration(int id, Guid moderatorId, RecitationModerateViewModel model); /// /// Get Upload Session (including files) /// /// /// Task> GetUploadSession(Guid id); /// /// Get User Profiles /// /// /// /// Task> GetUserNarrationProfiles(Guid userId, string artistName); /// /// Get User Default Profile /// /// /// Task> GetUserDefProfile(Guid userId); /// /// Add a narration profile /// /// /// Task> AddUserNarrationProfiles(UserRecitationProfileViewModel profile); /// /// Update a narration profile /// /// /// Task> UpdateUserNarrationProfiles(UserRecitationProfileViewModel profile); /// /// Delete a narration profile /// /// /// /// Task> DeleteUserNarrationProfiles(Guid id, Guid userId); /// /// Transfer Recitations Ownership /// /// /// /// /// Task> TransferRecitationsOwnership(Guid currentOwenerId, Guid newOwnerId, string artistName); /// /// Get uploads descending by upload time /// /// /// if userId is empty all user uploads would be returned /// Task> GetUploads(PagingParameterModel paging, Guid userId); /// /// publishing tracker data /// /// /// /// /// Task> GetPublishingQueueStatus(PagingParameterModel paging, bool unfinished, Guid filteredUserId); /// /// move recitaions of an artist to the first position /// /// /// Task> MakeArtistRecitationsFirst(string artistName); /// /// Synchronization Queue /// /// /// Task> GetSynchronizationQueue(Guid filteredUserId); /// /// report an error in a recitation /// /// /// /// Task> ReportErrorAsync(Guid userId, RecitationErrorReportViewModel report); /// /// get errors reported for recitations /// /// /// Task> GetReportedErrorsAsync(PagingParameterModel paging); /// /// reject a reported error for recitations and notify the reporter (and deletes the report) /// /// /// /// Task> RejectReportedErrorAsync(int id, string rejectionNote = "عدم تطابق با معیارهای حذف خوانش"); /// /// accepts a reported error for recitations, change status of the recitation to rejected and notify the reporter and recitation owner (and deletes the report) /// /// /// Task> AcceptReportedErrorAsync(int id); /// /// accepts a reported error for recitations, add mistake to approve the mistake and notify the reporter and recitation owner (and deletes the report) /// /// /// Task> AddReportToTheApprovedMistakesAsync(RecitationErrorReportViewModel report); /// /// remove approved mistake /// /// /// Task> RemoveApprovedMistakeAsync(int id); /// /// edit approved mistake text /// /// /// /// Task> EditApprovedMistakeAsync(int id, string reason); /// /// compute poem recitations order /// /// /// /// Task> ComputePoemRecitationsOrdersAsync(int poemId, bool update = true); /// /// up vote a recitation /// /// recitation id /// /// Task> UpVoteRecitationAsync(int id, Guid userId); /// /// revoke recitaion up vote /// /// recitaion id /// /// Task> RevokeUpVoteFromRecitationAsync(int id, Guid userId); /// /// switches recitation upvote /// /// /// /// upvote status Task> SwitchRecitationUpVoteAsync(int id, Guid userId); /// /// get user upvoted recitations /// /// /// /// Task> GetUserUpvotedRecitationsAsync(PagingParameterModel paging, Guid userId); /// /// check recitaions with missing files and add them to reported errors list /// /// /// RServiceResult StartCheckingRecitationsHealthCheck(Guid userId); /// /// retry publish unpublished narrations /// Task RetryPublish(); /// /// Upload Enabled (temporary switch off/on for upload) /// bool UploadEnabled { get; } } }