예제 #1
0
        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());
        }
예제 #2
0
 /// <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)));
 }
예제 #3
0
 /// <summary>
 /// Retrieve achievements of any type from the local database
 /// </summary>
 /// <returns></returns>
 public IEnumerable <AchievementBase> GetAchievements()
 {
     return(dataAccess.GetItems <AchievementBase>().ToList());
 }
예제 #4
0
 public IEnumerable <Quiz> QuizzesForExhibit(string exhibitId)
 {
     return(dataAccess.GetItems <Quiz>(nameof(Quiz.Exhibit), nameof(Quiz.Image))
            .Where(quiz => quiz.Exhibit.Id == exhibitId));
 }
예제 #5
0
 /// <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)));
 }