Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
## Bug Fixes
Browse files Browse the repository at this point in the history
* Fixed status label on 'Adding to existing playlists'
* Tinkered with FileSystemWatcher - Sometimes it's not grabbing file system changes
* Hopefully fixed object reference not set to an instance of an object in Playlist Processor
  • Loading branch information
jamesbrindle committed May 10, 2021
1 parent fced7d6 commit 73df2a4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Automatically upload your local personal music library to YouTube Music and bulk
 
 

**[Download Version 1.7.7 Installer](https://github.com/jamesbrindle/YTMusicUploader/releases/tag/v1.7.7)**
**[Download Version 1.7.8 Installer](https://github.com/jamesbrindle/YTMusicUploader/releases/tag/v1.7.8)**
 
 

Expand Down
6 changes: 3 additions & 3 deletions YTMusicUploader/Business/PlaylistProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using YTMusicUploader.Providers;
using YTMusicUploader.Providers.DataModels;
using static YTMusicUploader.Providers.RequestModels.ArtistCache;
Expand Down Expand Up @@ -328,15 +329,14 @@ private void HandleOnlinePlaylistPresent(
}
}

int index = 1;
foreach (var playlistItem in playlistFile.PlaylistItems)
{
int index = 1;

ConnectionCheckWait();
if (MainFormAborting() || !MainForm.Settings.UploadPlaylists)
return;

SetStatus($"Processing playlist file {currentPlaylistIndex}/{totalPlaylists}: Adding track to existing {index}/{playlistFile.PlaylistItems}",
SetStatus($"Processing playlist file {currentPlaylistIndex}/{totalPlaylists}: Adding track to existing {index}/{playlistFile.PlaylistItems.Count}",
$"Processing playlist file {currentPlaylistIndex}/{totalPlaylists}");

while (MainForm.Paused)
Expand Down
61 changes: 32 additions & 29 deletions YTMusicUploader/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public enum ManagingYTMusicStatusEnum

private bool StartHidden = false;


//
// MusicBrainz Access
//
Expand Down Expand Up @@ -241,39 +240,43 @@ private async Task InitialiseFolderWatchers()
{
try
{
FileSystemFolderWatchers.Clear();
FileSystemFolderWatchers.Clear();
foreach (var watchFolder in WatchFolders)
{
try
for (int i = 0; i < 3; i++)
{
FileSystemFolderWatchers.Add(new FileSystemWatcher
try
{
Path = watchFolder.Path,
NotifyFilter = NotifyFilters.CreationTime |
NotifyFilters.DirectoryName |
NotifyFilters.Size |
NotifyFilters.Attributes |
NotifyFilters.FileName |
NotifyFilters.LastWrite |
NotifyFilters.Size,
Filter = "*.*",
EnableRaisingEvents = true,
IncludeSubdirectories = true
});

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Changed += new FileSystemEventHandler(FolderWatcher_OnChanged);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Renamed += new RenamedEventHandler(FolderWatcher_OnRenamed);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Created += new FileSystemEventHandler(FolderWatcher_OnChanged);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Deleted += new FileSystemEventHandler(FolderWatcher_OnChanged);
FileSystemFolderWatchers.Add(new FileSystemWatcher
{
Path = watchFolder.Path,
NotifyFilter = NotifyFilters.CreationTime |
NotifyFilters.DirectoryName |
NotifyFilters.Size |
NotifyFilters.Attributes |
NotifyFilters.FileName |
NotifyFilters.LastWrite |
NotifyFilters.Size,
Filter = "*.*",
EnableRaisingEvents = true,
IncludeSubdirectories = true,
InternalBufferSize = 24000
});

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Changed += new FileSystemEventHandler(FolderWatcher_OnChanged);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Renamed += new RenamedEventHandler(FolderWatcher_OnRenamed);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Created += new FileSystemEventHandler(FolderWatcher_OnChanged);

FileSystemFolderWatchers[FileSystemFolderWatchers.Count - 1]
.Deleted += new FileSystemEventHandler(FolderWatcher_OnChanged);
}
catch { }
}
catch { }
}

await Task.Run(() => { });
Expand Down
3 changes: 2 additions & 1 deletion YTMusicUploader/YTMusicUploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -27,7 +28,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -210,6 +210,7 @@
<Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Common.4.7.0\lib\net461\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
Expand Down

0 comments on commit 73df2a4

Please sign in to comment.