public EntryForApiContract(Album album, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, EntryOptionalFields includedFields) : this(album, languagePreference) { ArtistString = album.ArtistString[languagePreference]; CreateDate = album.CreateDate; DiscType = album.DiscType; Status = album.Status; if (includedFields.HasFlag(EntryOptionalFields.MainPicture) && album.CoverPictureData != null) { MainPicture = new EntryThumbForApiContract(new EntryThumb(album, album.CoverPictureMime), thumbPersister, ssl); } if (includedFields.HasFlag(EntryOptionalFields.Names)) { Names = album.Names.Select(n => new LocalizedStringContract(n)).ToArray(); } if (includedFields.HasFlag(EntryOptionalFields.Tags)) { Tags = album.Tags.Usages.Select(u => new TagUsageForApiContract(u)).ToArray(); } if (includedFields.HasFlag(EntryOptionalFields.WebLinks)) { WebLinks = album.WebLinks.Select(w => new ArchivedWebLinkContract(w)).ToArray(); } }
public ArtistRelationsQuery(IDatabaseContext ctx, ContentLanguagePreference languagePreference, ObjectCache cache, IEntryThumbPersister entryThumbPersister) { this.ctx = ctx; this.languagePreference = languagePreference; this.cache = cache; this.entryThumbPersister = entryThumbPersister; }
public AlbumController(AlbumService service, AlbumQueries queries, UserQueries userQueries, IEntryThumbPersister imagePersister) { Service = service; this.queries = queries; this.userQueries = userQueries; this.imagePersister = imagePersister; }
public AlbumService(ISessionFactory sessionFactory, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IUserIconFactory userIconFactory, IEntryThumbPersister entryThumbPersister) : base(sessionFactory, permissionContext, entryLinkFactory) { this.userIconFactory = userIconFactory; this.entryThumbPersister = entryThumbPersister; }
public UserApiController(UserQueries queries, UserService service, IUserPermissionContext permissionContext, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.permissionContext = permissionContext; this.thumbPersister = thumbPersister; }
public AlbumForApiContract( Album album, AlbumMergeRecord mergeRecord, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, AlbumOptionalFields fields) : this(album, mergeRecord, languagePreference, fields.HasFlag(AlbumOptionalFields.Artists), fields.HasFlag(AlbumOptionalFields.Names), fields.HasFlag(AlbumOptionalFields.PVs), fields.HasFlag(AlbumOptionalFields.Tags), fields.HasFlag(AlbumOptionalFields.WebLinks)) { if (languagePreference != ContentLanguagePreference.Default || fields.HasFlag(AlbumOptionalFields.AdditionalNames)) { AdditionalNames = album.Names.GetAdditionalNamesStringForLanguage(languagePreference); } if (fields.HasFlag(AlbumOptionalFields.Identifiers)) { Identifiers = album.Identifiers.Select(i => new AlbumIdentifierContract(i)).ToArray(); } if (thumbPersister != null && fields.HasFlag(AlbumOptionalFields.MainPicture) && !string.IsNullOrEmpty(album.CoverPictureMime)) { MainPicture = new EntryThumbForApiContract(new EntryThumb(album, album.CoverPictureMime), thumbPersister, ssl); } }
public UserApiController(UserQueries queries, UserService service, IUserPermissionContext permissionContext, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.permissionContext = permissionContext; this.thumbPersister = thumbPersister; }
public ArtistForUserForApiContract(ArtistForUser artistForUser, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, ArtistOptionalFields includedFields) { Artist = new ArtistForApiContract(artistForUser.Artist, languagePreference, thumbPersister, includedFields); }
public static EntryForApiContract Create(IEntryWithNames entry, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, IEntryImagePersisterOld imagePersisterOld, bool ssl, EntryOptionalFields includedFields) { ParamIs.NotNull(() => entry); switch (entry.EntryType) { case EntryType.Album: return(new EntryForApiContract((Album)entry, languagePreference, thumbPersister, ssl, includedFields)); case EntryType.Artist: return(new EntryForApiContract((Artist)entry, languagePreference, thumbPersister, ssl, includedFields)); case EntryType.DiscussionTopic: return(new EntryForApiContract((DiscussionTopic)entry, languagePreference)); case EntryType.ReleaseEvent: return(new EntryForApiContract((ReleaseEvent)entry, thumbPersister, ssl, includedFields)); case EntryType.Song: return(new EntryForApiContract((Song)entry, languagePreference, includedFields)); case EntryType.SongList: return(new EntryForApiContract((SongList)entry, imagePersisterOld, ssl, includedFields)); case EntryType.Tag: return(new EntryForApiContract((Tag)entry, languagePreference, imagePersisterOld, ssl, includedFields)); } return(new EntryForApiContract(entry, languagePreference, includedFields)); }
public AlbumController(AlbumService service, AlbumQueries queries, UserQueries userQueries, IEntryThumbPersister imagePersister) { Service = service; this.queries = queries; this.userQueries = userQueries; this.imagePersister = imagePersister; }
public EntryQueries(IAlbumRepository repository, IUserPermissionContext permissionContext, IEntryThumbPersister entryThumbPersister, IEntryImagePersisterOld entryImagePersisterOld) : base(repository, permissionContext) { this.entryThumbPersister = entryThumbPersister; this.entryImagePersisterOld = entryImagePersisterOld; }
public AlbumForApiContract( Album album, AlbumMergeRecord mergeRecord, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, AlbumOptionalFields fields) : this(album, mergeRecord, languagePreference, fields.HasFlag(AlbumOptionalFields.Artists), fields.HasFlag(AlbumOptionalFields.Names), fields.HasFlag(AlbumOptionalFields.PVs), fields.HasFlag(AlbumOptionalFields.Tags), fields.HasFlag(AlbumOptionalFields.WebLinks)) { if (languagePreference != ContentLanguagePreference.Default || fields.HasFlag(AlbumOptionalFields.AdditionalNames)) { AdditionalNames = album.Names.GetAdditionalNamesStringForLanguage(languagePreference); } if (fields.HasFlag(AlbumOptionalFields.Identifiers)) { Identifiers = album.Identifiers.Select(i => new AlbumIdentifierContract(i)).ToArray(); } if (thumbPersister != null && fields.HasFlag(AlbumOptionalFields.MainPicture) && !string.IsNullOrEmpty(album.CoverPictureMime)) { MainPicture = new EntryThumbForApiContract(new EntryThumb(album, album.CoverPictureMime), thumbPersister, ssl); } }
public static EntryForApiContract Create(IEntryWithNames entry, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, IEntryImagePersisterOld imagePersisterOld, bool ssl, EntryOptionalFields includedFields) { ParamIs.NotNull(() => entry); if (entry is Album) { return(new EntryForApiContract((Album)entry, languagePreference, thumbPersister, ssl, includedFields)); } else if (entry is Artist) { return(new EntryForApiContract((Artist)entry, languagePreference, thumbPersister, ssl, includedFields)); } else if (entry is DiscussionTopic) { return(new EntryForApiContract((DiscussionTopic)entry, languagePreference)); } else if (entry is Song) { return(new EntryForApiContract((Song)entry, languagePreference, includedFields)); } else if (entry is Tag) { return(new EntryForApiContract((Tag)entry, imagePersisterOld, ssl, includedFields)); } throw new ArgumentException("Unsupported entry type: " + entry, "entry"); }
public EventQueries(IEventRepository eventRepository, IEntryLinkFactory entryLinkFactory, IUserPermissionContext permissionContext, IEntryThumbPersister imagePersister) : base(eventRepository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; }
public ArtistApiController(ArtistQueries queries, ArtistService service, IEntryThumbPersister thumbPersister, ObjectCache cache) { this.queries = queries; this.service = service; this.thumbPersister = thumbPersister; this.cache = cache; }
public ArtistQueries(IArtistRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, ObjectCache cache) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.cache = cache; }
public AlbumApiController(AlbumQueries queries, AlbumService service, OtherService otherService, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.otherService = otherService; this.thumbPersister = thumbPersister; }
public AlbumQueries(IAlbumRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IUserMessageMailer mailer) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.mailer = mailer; }
public OtherService(ISessionFactory sessionFactory, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IUserIconFactory userIconFactory, EntryForApiContractFactory entryForApiContractFactory, ObjectCache cache, IEntryThumbPersister thumbPersister) : base(sessionFactory, permissionContext, entryLinkFactory) { this.userIconFactory = userIconFactory; this.entryForApiContractFactory = entryForApiContractFactory; this.cache = cache; this.thumbPersister = thumbPersister; }
public AlbumForApiContract( Album album, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, AlbumOptionalFields fields, SongOptionalFields songFields = SongOptionalFields.None) : this(album, null, languagePreference, thumbPersister, fields, songFields) { }
public EventController(EventQueries queries, ReleaseEventService service, IEnumTranslations enumTranslations, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.enumTranslations = enumTranslations; this.entryLinkFactory = entryLinkFactory; this.thumbPersister = thumbPersister; }
public SongListQueries(ISongListRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IAggregatedEntryImageUrlFactory thumbStore, IUserIconFactory userIconFactory) : base(repository, permissionContext) { _entryLinkFactory = entryLinkFactory; _imagePersister = imagePersister; _thumbStore = thumbStore; _userIconFactory = userIconFactory; }
public ArtistForUserForApiContract(ArtistForUser artistForUser, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, ArtistOptionalFields includedFields) { Artist = new ArtistForApiContract(artistForUser.Artist, languagePreference, thumbPersister, ssl, includedFields); }
public ArtistForApiContract(Artist artist, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, ArtistOptionalFields includedFields) { ArtistType = artist.ArtistType; BaseVoicebank = artist.BaseVoicebank != null ? new ArtistContract(artist.BaseVoicebank, languagePreference) : null; CreateDate = artist.CreateDate; DefaultName = artist.DefaultName; DefaultNameLanguage = artist.Names.SortNames.DefaultLanguage; Id = artist.Id; Name = artist.Names.SortNames[languagePreference]; PictureMime = artist.PictureMime; Status = artist.Status; Version = artist.Version; if (includedFields.HasFlag(ArtistOptionalFields.AdditionalNames)) { AdditionalNames = artist.Names.GetAdditionalNamesStringForLanguage(languagePreference); } if (includedFields.HasFlag(ArtistOptionalFields.ArtistLinks)) { ArtistLinks = artist.Groups.Select(g => new ArtistForArtistForApiContract(g, LinkDirection.ManyToOne, languagePreference)).ToArray(); } if (includedFields.HasFlag(ArtistOptionalFields.ArtistLinksReverse)) { ArtistLinksReverse = artist.Members.Select(m => new ArtistForArtistForApiContract(m, LinkDirection.OneToMany, languagePreference)).ToArray(); } if (includedFields.HasFlag(ArtistOptionalFields.Description)) { Description = artist.Description[languagePreference]; } if (includedFields.HasFlag(ArtistOptionalFields.Names)) { Names = artist.Names.Select(n => new LocalizedStringContract(n)).ToArray(); } if (includedFields.HasFlag(ArtistOptionalFields.Tags)) { Tags = artist.Tags.ActiveUsages.Select(u => new TagUsageForApiContract(u, languagePreference)).ToArray(); } if (thumbPersister != null && includedFields.HasFlag(ArtistOptionalFields.MainPicture) && !string.IsNullOrEmpty(artist.PictureMime)) { MainPicture = new EntryThumbForApiContract(new EntryThumb(artist, artist.PictureMime), thumbPersister, ssl); } if (includedFields.HasFlag(ArtistOptionalFields.WebLinks)) { WebLinks = artist.WebLinks.Select(w => new WebLinkForApiContract(w)).ToArray(); } }
public EventQueries(IEventRepository eventRepository, IEntryLinkFactory entryLinkFactory, IUserPermissionContext permissionContext, IEntryThumbPersister imagePersister, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations, IUserMessageMailer mailer) : base(eventRepository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; this.mailer = mailer; }
public UserApiController(UserQueries queries, UserMessageQueries messageQueries, UserService service, IUserPermissionContext permissionContext, IEntryThumbPersister thumbPersister, IUserIconFactory userIconFactory) { this.queries = queries; this.messageQueries = messageQueries; this.service = service; this.permissionContext = permissionContext; this.thumbPersister = thumbPersister; this.userIconFactory = userIconFactory; }
public EntryForApiContract(ReleaseEvent releaseEvent, IEntryThumbPersister thumbPersister, bool ssl, EntryOptionalFields includedFields) : this(releaseEvent, ContentLanguagePreference.Default, includedFields) { ActivityDate = releaseEvent.Date.DateTime; ReleaseEventSeriesName = releaseEvent.Series != null ? releaseEvent.Series.Name : null; if (includedFields.HasFlag(EntryOptionalFields.MainPicture) && releaseEvent.Series != null && !string.IsNullOrEmpty(releaseEvent.Series.PictureMime)) { MainPicture = new EntryThumbForApiContract(new EntryThumb(releaseEvent.Series, releaseEvent.Series.PictureMime), thumbPersister, ssl); } }
public TagQueries(ITagRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryImagePersisterOld imagePersister, IEntryThumbPersister thumbStore, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.thumbStore = thumbStore; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; }
public AlbumQueries(IAlbumRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IEntryPictureFilePersister pictureFilePersister, IUserMessageMailer mailer, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.pictureFilePersister = pictureFilePersister; this.mailer = mailer; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; }
public TagQueries(ITagRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IAggregatedEntryImageUrlFactory thumbStore, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations, ObjectCache cache) : base(repository, permissionContext) { _entryLinkFactory = entryLinkFactory; _imagePersister = imagePersister; _thumbStore = thumbStore; _userIconFactory = userIconFactory; _enumTranslations = enumTranslations; _cache = cache; }
public ArtistQueries(IArtistRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IEntryPictureFilePersister pictureFilePersister, ObjectCache cache, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.pictureFilePersister = pictureFilePersister; this.cache = cache; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; }
public ArtistQueries(IArtistRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IEntryThumbPersister imagePersister, IEntryPictureFilePersister pictureFilePersister, ObjectCache cache, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations, IAggregatedEntryImageUrlFactory imageUrlFactory) : base(repository, permissionContext) { _entryLinkFactory = entryLinkFactory; _imagePersister = imagePersister; _pictureFilePersister = pictureFilePersister; _cache = cache; _userIconFactory = userIconFactory; _enumTranslations = enumTranslations; _imageUrlFactory = imageUrlFactory; }
public EventQueries(IEventRepository eventRepository, IEntryLinkFactory entryLinkFactory, IUserPermissionContext permissionContext, IEntryThumbPersister imagePersister, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations, IUserMessageMailer mailer, IFollowedArtistNotifier followedArtistNotifier, IAggregatedEntryImageUrlFactory imageUrlFactory) : base(eventRepository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.imagePersister = imagePersister; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; this.mailer = mailer; this.followedArtistNotifier = followedArtistNotifier; this.imageUrlFactory = imageUrlFactory; }
public ArtistForApiContract(Artist artist, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, ArtistOptionalFields includedFields) { ArtistType = artist.ArtistType; BaseVoicebank = artist.BaseVoicebank != null ? new ArtistContract(artist.BaseVoicebank, languagePreference) : null; CreateDate = artist.CreateDate; DefaultName = artist.DefaultName; DefaultNameLanguage = artist.Names.SortNames.DefaultLanguage; Id = artist.Id; Name = artist.Names.SortNames[languagePreference]; PictureMime = artist.PictureMime; Status = artist.Status; Version = artist.Version; if (languagePreference != ContentLanguagePreference.Default || includedFields.HasFlag(ArtistOptionalFields.AdditionalNames)) { AdditionalNames = artist.Names.GetAdditionalNamesStringForLanguage(languagePreference); } if (languagePreference != ContentLanguagePreference.Default) { LocalizedName = artist.Names.SortNames[languagePreference]; } if (includedFields.HasFlag(ArtistOptionalFields.Description)) Description = artist.Description; if (includedFields.HasFlag(ArtistOptionalFields.Groups)) Groups = artist.Groups.Select(g => new ArtistContract(g.Group, languagePreference)).ToArray(); if (includedFields.HasFlag(ArtistOptionalFields.Members)) Members = artist.Members.Select(m => new ArtistContract(m.Member, languagePreference)).ToArray(); if (includedFields.HasFlag(ArtistOptionalFields.Names)) Names = artist.Names.Select(n => new LocalizedStringContract(n)).ToArray(); if (includedFields.HasFlag(ArtistOptionalFields.Tags)) Tags = artist.Tags.Usages.Select(u => new TagUsageForApiContract(u)).ToArray(); if (thumbPersister != null && includedFields.HasFlag(ArtistOptionalFields.MainPicture) && !string.IsNullOrEmpty(artist.PictureMime)) { MainPicture = new EntryThumbForApiContract(new EntryThumb(artist, artist.PictureMime), thumbPersister, ssl); } if (includedFields.HasFlag(ArtistOptionalFields.WebLinks)) WebLinks = artist.WebLinks.Select(w => new ArchivedWebLinkContract(w)).ToArray(); }
public SongQueries(ISongRepository repository, IUserPermissionContext permissionContext, IEntryLinkFactory entryLinkFactory, IPVParser pvParser, IUserMessageMailer mailer, ILanguageDetector languageDetector, IUserIconFactory userIconFactory, IEnumTranslations enumTranslations, IEntryThumbPersister entryThumbPersister, ObjectCache cache, VdbConfigManager config) : base(repository, permissionContext) { this.entryLinkFactory = entryLinkFactory; this.pvParser = pvParser; this.mailer = mailer; this.languageDetector = languageDetector; this.userIconFactory = userIconFactory; this.enumTranslations = enumTranslations; this.entryThumbPersister = entryThumbPersister; this.cache = cache; this.config = config; }
public TagDetailsContract(Tag tag, IEnumerable <Artist> artists, int artistCount, IEnumerable <Album> albums, int albumCount, IEnumerable <Song> songs, int songCount, IEnumerable <ReleaseEventSeries> eventSeries, int eventSeriesCount, IEnumerable <ReleaseEvent> events, int eventCount, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbStore) : base(tag, languagePreference) { AdditionalNames = tag.Names.AdditionalNamesString; Translations = tag.Names.GetTranslationsString(languagePreference); Albums = albums.Select(a => new AlbumContract(a, languagePreference)).ToArray(); AlbumCount = albumCount; Artists = artists.Select(a => new ArtistContract(a, languagePreference)).ToArray(); ArtistCount = artistCount; Description = tag.Description; RelatedTags = tag.RelatedTags .Where(t => !t.LinkedTag.Deleted) .Select(a => new TagBaseContract(a.LinkedTag, languagePreference, true)) .OrderBy(t => t.Name) .ToArray(); Children = tag.Children .Select(a => new TagBaseContract(a, languagePreference)) .OrderBy(t => t.Name) .ToArray(); EventSeries = eventSeries.Select(a => new ReleaseEventSeriesContract(a, languagePreference, false)).ToArray(); EventSeriesCount = eventSeriesCount; Events = events.Select(a => new ReleaseEventForApiContract(a, languagePreference, ReleaseEventOptionalFields.AdditionalNames | ReleaseEventOptionalFields.MainPicture, thumbStore)).ToArray(); EventCount = eventCount; Siblings = tag.Siblings .Select(a => new TagBaseContract(a, languagePreference)) .OrderBy(t => t.Name) .ToArray(); Songs = songs.Select(a => new SongForApiContract(a, languagePreference, SongOptionalFields.AdditionalNames | SongOptionalFields.ThumbUrl)).ToArray(); SongCount = songCount; Thumb = (tag.Thumb != null ? new EntryThumbContract(tag.Thumb) : null); WebLinks = tag.WebLinks.Links.Select(w => new WebLinkContract(w)).OrderBy(w => w.DescriptionOrUrl).ToArray(); MappedNicoTags = tag.Mappings.Select(t => t.SourceTag).ToArray(); }
public AlbumForUserForApiContract( AlbumForUser albumForUser, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl, AlbumOptionalFields fields, bool shouldShowCollectionStatus) { Album = new AlbumForApiContract(albumForUser.Album, null, languagePreference, thumbPersister, ssl, fields); Rating = albumForUser.Rating; if (shouldShowCollectionStatus) { MediaType = albumForUser.MediaType; PurchaseStatus = albumForUser.PurchaseStatus; } }
public AlbumApiController(AlbumQueries queries, AlbumService service, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.thumbPersister = thumbPersister; }
public ArtistApiController(ArtistQueries queries, ArtistService service, IEntryThumbPersister thumbPersister) { this.queries = queries; this.service = service; this.thumbPersister = thumbPersister; }
public ReleaseEventApiController(IEventRepository repository, IEntryThumbPersister thumbPersister) { this.repository = repository; this.thumbPersister = thumbPersister; }