#42 AudioOrder fix

This commit is contained in:
Hamid Reza Mohammadi 2020-11-26 10:19:59 +03:30
parent bf9962ea2f
commit b2cda2e7fe

View File

@ -818,7 +818,7 @@ namespace RMuseum.Services.Implementation
GanjoorPostId = audio.PoemId, GanjoorPostId = audio.PoemId,
OwnerId = session.UseId, OwnerId = session.UseId,
GanjoorAudioId = 1 + await context.Recitations.OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), GanjoorAudioId = 1 + await context.Recitations.OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(),
AudioOrder = 1 + await context.Recitations.Where(a => a.GanjoorPostId == audio.PoemId).OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), AudioOrder = 1 + await context.Recitations.Where(a => a.GanjoorPostId == audio.PoemId).OrderByDescending(a => a.GanjoorAudioId).Select(a => a.AudioOrder).FirstOrDefaultAsync(),
FileNameWithoutExtension = fileNameWithoutExtension, FileNameWithoutExtension = fileNameWithoutExtension,
SoundFilesFolder = currentTargetFolder, SoundFilesFolder = currentTargetFolder,
AudioTitle = string.IsNullOrEmpty(audio.PoemTitle) ? audio.Description : audio.PoemTitle, AudioTitle = string.IsNullOrEmpty(audio.PoemTitle) ? audio.Description : audio.PoemTitle,