Example #1
0
        public Collection GetCollectionById(string id)
        {
            try
            {
                var collection = _dbOperator.GetCollectionById(id);
                if (collection is null)
                {
                    Notification.Push(I18NUtil.GetString("err-collectionNotInDb"), I18NUtil.GetString("text-error"));
                }

                return(collection);
            }
            catch (Exception ex)
            {
                Notification.Push($"Error while getting collection by id: {ex.Message}");
                return(null);
            }
        }
Example #2
0
        public Beatmap GetBeatmapByIdentifiable(IMapIdentifiable beatmap)
        {
            Beatmap map;

            try
            {
                map = _dbOperator.GetBeatmapByIdentifiable(beatmap);
                if (map is null)
                {
                    Notification.Push(I18NUtil.GetString("err-mapNotInDb"), I18NUtil.GetString("text-error"));
                }
            }
            catch (Exception ex)
            {
                Notification.Push($"Error while getting beatmap by IMapIdentifiable from database: {ex.Message}");
                map = null;
            }

            return(map);
        }