public void Get_Artist_By_Name() { var optionsBuilder = new DbContextOptionsBuilder <RoadieDbContext>(); optionsBuilder.UseMySql("server=voyager;userid=roadie;password=MenAtW0rk668;persistsecurityinfo=True;database=roadie;ConvertZeroDateTime=true"); using (var context = new RoadieDbContext(optionsBuilder.Options)) { IArtistLookupEngine artistLookupEngine = new ArtistLookupEngine(this.Configuration, this.HttpEncoder, context, this.CacheManager, this.Logger); var a = artistLookupEngine.DatabaseQueryForArtistName("Nas"); } }
private async Task <string> DetermineArtistFolder(AudioMetaData metaData, bool doJustInfo) { var artist = await ArtistLookupEngine.GetByName(metaData, !doJustInfo).ConfigureAwait(false); if (!artist.IsSuccess) { return(null); } try { return(artist.Data.ArtistFileFolder(Configuration)); } catch (Exception ex) { Logger.LogError(ex, ex.Serialize()); } return(null); }
public AdminService(IRoadieSettings configuration, IHttpEncoder httpEncoder, IHttpContext httpContext, data.IRoadieDbContext context, ICacheManager cacheManager, ILogger <ArtistService> logger, IHubContext <ScanActivityHub> scanActivityHub ) : base(configuration, httpEncoder, context, cacheManager, logger, httpContext) { ScanActivityHub = scanActivityHub; EventMessageLogger = new EventMessageLogger(); EventMessageLogger.Messages += EventMessageLogger_Messages; MusicBrainzProvider = new MusicBrainzProvider(configuration, cacheManager, MessageLogger); LastFmHelper = new LastFmHelper(configuration, cacheManager, MessageLogger, context, httpEncoder); FileNameHelper = new FileNameHelper(configuration, cacheManager, MessageLogger); ID3TagsHelper = new ID3TagsHelper(configuration, cacheManager, MessageLogger); ArtistLookupEngine = new ArtistLookupEngine(configuration, httpEncoder, context, cacheManager, MessageLogger); LabelLookupEngine = new LabelLookupEngine(configuration, httpEncoder, context, cacheManager, MessageLogger); ReleaseLookupEngine = new ReleaseLookupEngine(configuration, httpEncoder, context, cacheManager, MessageLogger, ArtistLookupEngine, LabelLookupEngine); ImageFactory = new ImageFactory(configuration, httpEncoder, context, cacheManager, MessageLogger, ArtistLookupEngine, ReleaseLookupEngine); LabelFactory = new LabelFactory(configuration, httpEncoder, context, cacheManager, MessageLogger, ArtistLookupEngine, ReleaseLookupEngine); AudioMetaDataHelper = new AudioMetaDataHelper(configuration, httpEncoder, context, MusicBrainzProvider, LastFmHelper, cacheManager, MessageLogger, ArtistLookupEngine, ImageFactory, FileNameHelper, ID3TagsHelper); ReleaseFactory = new ReleaseFactory(configuration, httpEncoder, context, cacheManager, MessageLogger, ArtistLookupEngine, LabelFactory, AudioMetaDataHelper, ReleaseLookupEngine); ArtistFactory = new ArtistFactory(configuration, httpEncoder, context, cacheManager, MessageLogger, ArtistLookupEngine, ReleaseFactory, ImageFactory, ReleaseLookupEngine, AudioMetaDataHelper); }
private async Task <string> DetermineReleaseFolder(string artistFolder, AudioMetaData metaData, bool doJustInfo, int?submissionId) { var artist = await ArtistLookupEngine.GetByName(metaData, !doJustInfo).ConfigureAwait(false); if (!artist.IsSuccess) { return(null); } _artistId = artist.Data.RoadieId; var release = await ReleaseLookupEngine.GetByName(artist.Data, metaData, !doJustInfo, submissionId : submissionId).ConfigureAwait(false); if (!release.IsSuccess) { return(null); } _releaseId = release.Data.RoadieId; release.Data.ReleaseDate = SafeParser.ToDateTime(release.Data.ReleaseYear ?? metaData.Year); if (release.Data.ReleaseYear.HasValue && release.Data.ReleaseYear != metaData.Year) { Logger.LogWarning($"Found Release `{release.Data}` has different Release Year than MetaData Year `{metaData}`"); } return(release.Data.ReleaseFileFolder(artistFolder)); }