public async Task PruneMediaFilesAsync(IReadOnlyDataAccess dataAccess) { var fileManager = IoCManager.Resolve <IMediaFileManager>(); var restApiIdsToKeep = dataAccess.GetItems <Audio>() .Select(it => it.IdForRestApi) .Union(dataAccess.GetItems <Image>().Select(it => it.IdForRestApi)); await fileManager.PruneAsync(restApiIdsToKeep.ToList()); }
/// <summary> /// Returns all existing Routes including their waypoints, tags, images and audio. /// </summary> /// <returns>The enumerable of all avaible routes</returns> public IEnumerable <Route> GetRoutes() { return(dataAccess.GetItems <Route>( nameof(Route.TagsRefs) + '.' + nameof(JoinRouteTag.Tag) + '.' + nameof(RouteTag.Image), nameof(Route.Image), nameof(Route.Audio), nameof(Route.Waypoints) + '.' + nameof(Waypoint.Exhibit))); }
/// <summary> /// Retrieve achievements of any type from the local database /// </summary> /// <returns></returns> public IEnumerable <AchievementBase> GetAchievements() { return(dataAccess.GetItems <AchievementBase>().ToList()); }
public IEnumerable <Quiz> QuizzesForExhibit(string exhibitId) { return(dataAccess.GetItems <Quiz>(nameof(Quiz.Exhibit), nameof(Quiz.Image)) .Where(quiz => quiz.Exhibit.Id == exhibitId)); }
/// <summary> /// Gets all available exhibits including their image and the IDs of their pages. /// </summary> /// <returns>The enumerable of all available exhibits.</returns> public IEnumerable <Exhibit> GetExhibits() { return(dataAccess.GetItems <Exhibit>( nameof(Exhibit.Image), nameof(Exhibit.PagesRefs) + '.' + nameof(JoinExhibitPage.Page) + '.' + nameof(Page.Audio))); }