public ShowImageCommandProcessorBase(string keyword
                                      , ImageGenre imageGenre
                                      , LineService lineService
                                      , IImageAccessor imageAccessor
                                      , IRandomNumberService randomNumberService
                                      ) : base(keyword, lineService)
 {
     Keyword              = keyword;
     _lineService         = lineService;
     _imageAccessor       = imageAccessor;
     _randomNumberService = randomNumberService;
     Genre = imageGenre;
 }
Beispiel #2
0
 private MediaContainer CreateMediaContainer(int id, string name, ImageGenre genre, int mediaType, ImageSource source)
 {
     return(new MediaContainer
     {
         Id = id,
         Name = name,
         GenreId = genre,
         IsEnabled = false,
         MediaTypeId = mediaType, // needs constants, 1 is image ,
         Path = string.Empty,
         SourceId = source,
         UseSubFolders = false
     });
 }
Beispiel #3
0
        public MediaContainer GetOrCreate(int mediaTypeId, ImageSource mediaSource, ImageGenre mediaGenre)
        {
            var mediaContainer = _mediaContainerRepository.Get().FirstOrDefault(mc => mc.MediaTypeId == mediaTypeId && mc.SourceId == mediaSource && mc.GenreId == mediaGenre);

            return(mediaContainer ?? _mediaContainerRepository.Create(new MediaContainer
            {
                GenreId = mediaGenre,
                IsEnabled = true,
                MediaTypeId = mediaTypeId,
                Name = mediaGenre.ToString(),
                SourceId = mediaSource,
                UseSubFolders = true
            }).Value);
        }