/// <summary> /// Handles a given message /// </summary> /// <param name="client"> /// The client. /// </param> /// <param name="collectionManager"> /// The collection manager. /// </param> /// <param name="resultHandler"> /// The result handler. /// </param> /// <param name="messageText"> /// The message text. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> public async Task HandleMessage( IDdpConnectionSender client, ICollectionManager collectionManager, IResultHandler resultHandler, string messageText) { JObject message = JObject.Parse(messageText); if (message["msg"] != null) { var msg = message["msg"]; if (msg != null) { var messageType = (string)msg; foreach (var handler in this.handlers) { if (handler.CanHandle(messageType)) { await handler.HandleMessage(client, collectionManager, resultHandler, messageText); } } } } }
public ImportTracksDiscEditor(ICollectionManager collectionManager) { this.collectionManager = collectionManager; this.DataContext = this; InitializeComponent(); }
public DiscogsReleaseMerger(Window window, ICollectionManager collectionManager, Release release, ReleaseImagesEditor imagesEditor) { this.window = window; this.collectionManager = collectionManager; this.release = release; this.imagesEditor = imagesEditor; this.discs = new List<IEnumerable<Tuple<Track, string>>>(); }
public ExportTester(ICollectionManager collectionManager) : base(collectionManager) { this.factory = new MemorySessionFactory(); this.memoryCollection = this.factory.CreateCollectionManager(); this.releaseComparer = new ReleaseEqualityComparer(true); this.importTester = new ImportTester(this.memoryCollection); }
public ViewReleaseImagesWindow(ICollectionManager collectionManager, Release release) { this.release = release; this.CollectionManager = collectionManager; InitializeComponent(); this.releaseImagesEditor.CollectionManager = this.CollectionManager; this.releaseImagesEditor.Release = release; }
public LocalCollectionMatcher(ICollectionManager collectionManager) { this.collectionScanner = new LocalCollectionScanner(collectionManager); this.collectionScanner.ProgressChanged += (sender, e) => { this.OnCollectionScannerProgressChanged(e); }; this.collectionManager = collectionManager; }
public UserViewManager(ILibraryManager libraryManager, ILocalizationManager localizationManager, IUserManager userManager, IChannelManager channelManager, ILiveTvManager liveTvManager, IPlaylistManager playlists, ICollectionManager collectionManager, IServerConfigurationManager config) { _libraryManager = libraryManager; _localizationManager = localizationManager; _userManager = userManager; _channelManager = channelManager; _liveTvManager = liveTvManager; _playlists = playlists; _collectionManager = collectionManager; _config = config; }
/// <summary> /// Processes the changed message /// </summary> /// <param name="client"> /// The connection to send replies to the server /// </param> /// <param name="collectionManager"> /// The CollectionManager /// </param> /// <param name="resultHandler"> /// The ResultHandler /// </param> /// <param name="message"> /// The message to process /// </param> /// <returns> /// Task to process the message /// </returns> public override Task HandleMessage( IDdpConnectionSender client, ICollectionManager collectionManager, IResultHandler resultHandler, string message) { var changedMessage = JsonConvert.DeserializeObject<Changed>(message); collectionManager.Changed(changedMessage); return Task.FromResult(true); }
public LocalCollectionMerger(ICollectionManager collectionManager, LocalCollectionMatcherResult matcherResult, bool saveToFiles) { this.collectionManager = collectionManager; this.matcherResult = matcherResult; this.saveToFiles = saveToFiles; this.total = this.matcherResult.NewReleases.Count + this.matcherResult.ChangedReleases.Count + this.matcherResult.DeletedReleases.Count; }
/// <summary> /// Processes the ping message /// </summary> /// <param name="client"> /// The connection to send replies to the server /// </param> /// <param name="collectionManager"> /// The CollectionManager /// </param> /// <param name="resultHandler"> /// The ResultHandler /// </param> /// <param name="message"> /// The message to process /// </param> /// <returns> /// Task to process the message /// </returns> public override Task HandleMessage( IDdpConnectionSender client, ICollectionManager collectionManager, IResultHandler resultHandler, string message) { var pingMessage = JsonConvert.DeserializeObject<Ping>(message); var pongReply = new Pong() { Id = pingMessage.Id }; return client.SendObject(pongReply); }
/// <summary> /// Processes the reply message /// </summary> /// <param name="client"> /// The connection to send replies to the server /// </param> /// <param name="collectionManager"> /// The CollectionManager /// </param> /// <param name="resultHandler"> /// The ResultHandler /// </param> /// <param name="message"> /// The message to process /// </param> /// <returns> /// Task to process the message /// </returns> public Task HandleMessage( IDdpConnectionSender client, ICollectionManager collectionManager, IResultHandler resultHandler, string message) { JObject parsedObject = JObject.Parse(message); var result = new ReturnedObject((string)parsedObject["msg"], parsedObject, message); resultHandler.AddResult(result); return Task.FromResult(true); }
// static constructor //static Configuration() //{ // var connectionString = //ConfigurationManager.ConnectionStrings["MongoRepositoryTestsConnectionString"].ConnectionString ?? // "mongodb://localhost/?w=1"; // var mongoUrl = new MongoUrl(connectionString); // var clientSettings = MongoClientSettings.FromUrl(mongoUrl); // if (!clientSettings.WriteConcern.Enabled) // { // clientSettings.WriteConcern.W = 1; // ensure WriteConcern is enabled regardless of what the URL says // } // __testClient = new MongoClient(clientSettings); // __testServer = __testClient.GetServer(); // __testDatabase = __testServer.GetDatabase("csharpdriverunittests"); // __testCollection = new CollectionManager(__testDatabase); //} static Configuration() { var connectionString = ConfigurationManager.ConnectionStrings["MongoRepositoryTestsConnectionString"].ConnectionString; var mongoUrl = new MongoUrl(connectionString); var clientSettings = MongoClientSettings.FromUrl(mongoUrl); if (!clientSettings.WriteConcern.Enabled) { clientSettings.WriteConcern.W = 1; // ensure WriteConcern is enabled regardless of what the URL says } __testClient = new MongoClient(clientSettings); __testServer = __testClient.GetServer(); __testDatabase = __testServer.GetDatabase("MongoRepositoryTests"); __testCollection = new CollectionManager(__testDatabase); }
public void CommitChanges(ICollectionManager collectionManager) { if (this.Release.Artists.Join() != this.Release.JoinedAlbumArtists) { this.Release.Artists.Clear(); this.Release.Artists.Add(new ReleaseArtist() { Artist = collectionManager.GetOrCreateArtist(this.Release.JoinedAlbumArtists) }); } this.Release.ReleaseDate = ReleaseDate.Parse(this.textReleaseDate.Text); this.Release.OriginalReleaseDate = ReleaseDate.Parse(this.textOriginalReleaseDate.Text); int discogsRelease, discogsMaster; int.TryParse(this.textDiscogsRelease.Text, out discogsRelease); int.TryParse(this.textDiscogsMaster.Text, out discogsMaster); this.Release.DiscogsReleaseId = discogsRelease; this.Release.DiscogsMasterId = discogsMaster; this.Release.WikipediaPageName = this.textWikipediaPageName.Text; }
public DiscogsMatchWindow(ICollectionManager manager, IEnumerable<Tuple<TrackEntity, string>> tracks, Release release) { this.collectionManager = manager; this.FixNames = true; this.release = release; this.matchItems = tracks.Select(i => new MatchItem(i.Item1, i.Item2)).ToArray(); InitializeComponent(); this.listReleaseTracklist.DataContext = release; this.listReleaseTracklist.ItemsSource = release.Tracklist; this.listMatching.ItemsSource = matchItems; for (int i = 0; i < this.listReleaseTracklist.Items.Count; ++i) { Track t = (Track)this.listReleaseTracklist.Items[i]; if (this.IsValidTrack(t)) { this.listReleaseTracklist.SelectedItems.Add(t); } } }
public CollectionImporterBase(ICollectionManager collectionManager) { this.collectionManager = collectionManager; this.readBuffer = new byte[128 * 1024]; }
/// <summary> /// Initializes a new instance of the <see cref="ItemsService" /> class. /// </summary> /// <param name="userManager">The user manager.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="userDataRepository">The user data repository.</param> /// <param name="localization">The localization.</param> /// <param name="dtoService">The dto service.</param> /// <param name="collectionManager">The collection manager.</param> public ItemsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, ILocalizationManager localization, IDtoService dtoService, ICollectionManager collectionManager) { _userManager = userManager; _libraryManager = libraryManager; _userDataRepository = userDataRepository; _localization = localization; _dtoService = dtoService; _collectionManager = collectionManager; }
/// <summary> /// Handles a given message /// </summary> /// <param name="client"> /// The client. /// </param> /// <param name="collectionManager"> /// The collection manager. /// </param> /// <param name="resultHandler"> /// The result handler. /// </param> /// <param name="message"> /// The message. /// </param> /// <returns> /// The <see cref="Task"/>. The task should be used to execute any long running operation (for instance, needing to send a message to the server as part of handling the message). /// </returns> public abstract Task HandleMessage( IDdpConnectionSender client, ICollectionManager collectionManager, IResultHandler resultHandler, string message);
public CollectionManagerOperations(ICollectionManager collectionManager) { this.collectionManager = collectionManager; }
public XmlReleaseImporter(string path, ICollectionManager collectionManager) : base(collectionManager) { this.path = path; }
public ArchivedCollectionExporter(string outputPath, ICollectionManager collectionManager) : base(collectionManager) { this.zipOutputStream = new ZipOutputStream(File.Create(outputPath)); this.zipOutputStream.SetLevel(9); }
public static Task DropScopeAsync(this ICollectionManager manager, string scopeName) { return(manager.DropScopeAsync(scopeName, DropScopeOptions.Default)); }
public CollectionService(ICollectionManager collectionManager, IDtoService dtoService) { _collectionManager = collectionManager; _dtoService = dtoService; }
public static Task CreateCollectionAsync(this ICollectionManager manager, CollectionSpec spec) { return(manager.CreateCollectionAsync(spec, CreateCollectionOptions.Default)); }
public static Task DropCollectionAsync(this ICollectionManager manager, CollectionSpec spec) { return(manager.DropCollectionAsync(spec, DropCollectionOptions.Default)); }
public static Task <IEnumerable <ScopeSpec> > GetAllScopesAsync(this ICollectionManager manager) { return(manager.GetAllScopesAsync(GetAllScopesOptions.Default)); }
public static Task <ScopeSpec> GetScopeAsync(this ICollectionManager manager, string scopeName) { return(manager.GetScopeAsync(scopeName, GetScopeOptions.Default)); }
public static Task CreateScopeAsync(this ICollectionManager manager, ScopeSpec scopeSpec) { return(manager.CreateScopeAsync(scopeSpec, CreateScopeOptions.Default)); }
public UserViewManager(ILibraryManager libraryManager, ILocalizationManager localizationManager, IUserManager userManager, IChannelManager channelManager, ILiveTvManager liveTvManager, IPlaylistManager playlists, ICollectionManager collectionManager, IServerConfigurationManager config) { _libraryManager = libraryManager; _localizationManager = localizationManager; _userManager = userManager; _channelManager = channelManager; _liveTvManager = liveTvManager; _playlists = playlists; _collectionManager = collectionManager; _config = config; }
public EncodingTargetScanner(ICollectionManager collectionManager, EncodingTarget encodingTarget) { this.collectionManager = collectionManager; this.encodingTarget = encodingTarget; }
public CollectionService(ICollectionManager collectionManager, IDtoService dtoService, IAuthorizationContext authContext) { _collectionManager = collectionManager; _dtoService = dtoService; _authContext = authContext; }
public ArchivedCollectionImporter(string inputPath, ICollectionManager collectionManager) : base(collectionManager) { this.zipFile = new ZipFile(inputPath); }
public ArchivedCollectionExporter(string outputPath, ICollectionManager collectionManager) : base(collectionManager) { this.zipOutputStream = new ZipOutputStream(File.Create(outputPath)); this.zipOutputStream.SetLevel(9); }
public void Dispose() { this.CollectionManager.Dispose(); this.CollectionManager = null; }
public TrailersService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IDtoService dtoService, ICollectionManager collectionManager, ILocalizationManager localizationManager, IJsonSerializer json) { _userManager = userManager; _userDataRepository = userDataRepository; _libraryManager = libraryManager; _dtoService = dtoService; _collectionManager = collectionManager; _localizationManager = localizationManager; _json = json; }
public string GetAbsoluteFilename(ICollectionManager collectionManager) { return Path.Combine(collectionManager.Settings.MusicDirectory, this.RelativeFilename); }
public TMDbCollectionsService(ILibraryManager libraryManager, ICollectionManager collectionManager, ILogger <TMDbCollectionsService> logger, ILogger <TMDbBoxSetManager> boxset_logger) { _tmDbBoxSetManager = new TMDbBoxSetManager(libraryManager, collectionManager, boxset_logger); _logger = logger; }
public DirectoryCollectionImporter(string path, ICollectionManager collectionManager) : base(collectionManager) { this.path = path; }
public ImportTester(ICollectionManager collectionManager) : base(collectionManager) { }
public AddCollection(ILibraryManager libraryManager, ICollectionManager collectionManager) { this.libraryManager = libraryManager; this.collectionManager = collectionManager; }
public HelperBase(MusicDatabaseWindow parentWindow, ICollectionSessionFactory collectionSessionFactory) { this.ParentWindow = parentWindow; this.CollectionManager = collectionSessionFactory.CreateCollectionManager(); }
public DirectoryCollectionExporter(string outputPath, ICollectionManager collectionManager) : base(collectionManager) { this.outputPath = outputPath; }
public CollectionImporterBase(ICollectionManager collectionManager) { this.collectionManager = collectionManager; this.readBuffer = new byte[128 * 1024]; }
public string GetDirectory(ICollectionManager collectionManager) { return Path.GetDirectoryName(this.Tracklist[0].GetAbsoluteFilename(collectionManager)); }
public EncodingTargetScanner(ICollectionManager collectionManager, EncodingTarget encodingTarget) { this.collectionManager = collectionManager; this.encodingTarget = encodingTarget; }
public CollectionController() { _collectionManager = DIContainer.Instance.Resolve <ICollectionManager>(); }
public void CommitChanges(ICollectionManager collectionManager) { bool hasTrackArtists = this.Release.Tracklist.Any(t => !string.IsNullOrEmpty(t.JoinedArtists)); foreach (ImportTrackItem track in this.Tracks) { if (hasTrackArtists) { if (track.Track.Artists.Join() != track.Track.JoinedArtists) { if (string.IsNullOrEmpty(track.Track.JoinedArtists)) { track.Track.Artists.Clear(); track.Track.Artists.AddRange(this.Release.Artists.Select(releaseArtist => new TrackArtist() { Artist = releaseArtist.Artist, JoinString = releaseArtist.JoinString })); track.Track.JoinedArtists = Release.JoinedAlbumArtists; } else { track.Track.Artists.Clear(); track.Track.Artists.Add(new TrackArtist() { Artist = collectionManager.GetOrCreateArtist(track.Track.JoinedArtists) }); } } } else { track.Track.Artists.Clear(); } } }
public string GetDirectory(ICollectionManager collectionManager) { return(Path.GetDirectoryName(this.Tracklist[0].GetAbsoluteFilename(collectionManager))); }
public LocalCollectionScanner(ICollectionManager collectionManager) { this.collectionManager = collectionManager; this.LocalCollection = new LocalCollection(); }
public LocalCollectionScanner(ICollectionManager collectionManager) { this.collectionManager = collectionManager; this.LocalCollection = new LocalCollection(); }
public CollectionStatisticsGenerator(ICollectionManager collectionManager) { this.collectionManager = collectionManager; }
public CollectionManagerEntryPoint(ICollectionManager collectionManager, IServerConfigurationManager config, ILogger logger) { _collectionManager = (CollectionManager)collectionManager; _config = config; _logger = logger; }
public XmlReleaseImporter(string path, ICollectionManager collectionManager) : base(collectionManager) { this.path = path; }
public CollectionExporterBase(ICollectionManager collectionManager) { this.collectionManager = collectionManager; }
private void MusicDatabaseWindow_Closed(object sender, EventArgs e) { if (this.collectionManager != null) { if (this.shouldDisposeCollectionManager) { this.collectionManager.Dispose(); } this.collectionManager = null; } this.SettingsManager.Dispose(); CollectionManagerGlobal.CollectionChanged -= this.CollectionManager_CollectionChanged; }
public ImportTester(ICollectionManager collectionManager) : base(collectionManager) { }