Skip to content

Commit

Permalink
Replace all references to "folder" with "directory" for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonQ committed May 29, 2020
1 parent 0a244e8 commit bfe99e5
Show file tree
Hide file tree
Showing 20 changed files with 432 additions and 446 deletions.
50 changes: 25 additions & 25 deletions Music Folder Syncer.sln → Music Directory Syncer.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Music Folder Syncer", "Music Folder Syncer.vbproj", "{0B6BF188-5EA1-4928-869E-69ED233E80A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Debug|x64.ActiveCfg = Debug|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Debug|x64.Build.0 = Debug|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Release|x64.ActiveCfg = Release|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BCECA4B7-9E79-4CB7-8F5A-DE9CD282986A}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Music Directory Syncer", "Music Directory Syncer.vbproj", "{0B6BF188-5EA1-4928-869E-69ED233E80A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Debug|x64.ActiveCfg = Debug|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Debug|x64.Build.0 = Debug|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Release|x64.ActiveCfg = Release|x64
{0B6BF188-5EA1-4928-869E-69ED233E80A6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BCECA4B7-9E79-4CB7-8F5A-DE9CD282986A}
EndGlobalSection
EndGlobal
574 changes: 287 additions & 287 deletions Music Folder Syncer.vbproj → Music Directory Syncer.vbproj

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions Music Folder Syncer.vbproj.user

This file was deleted.

6 changes: 3 additions & 3 deletions My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Imports System.Resources

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("Music Folder Syncer")>
<Assembly: AssemblyTitle("Music Directory Syncer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Music Folder Syncer")>
<Assembly: AssemblyProduct("Music Directory Syncer")>

<Assembly: AssemblyCopyright("Copyright © DragonQ 2017")>
<Assembly: AssemblyCopyright("Copyright © DragonQ 2020")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>

Expand Down
4 changes: 2 additions & 2 deletions My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Music Folder Syncer
# Music Directory Syncer

Music Folder Syncer is a Windows application that allows a directory of music files to be synced to any number of others, according to certain rulesets:
Music Directory Syncer is a Windows application that allows a directory of music files to be synced to any number of others, according to certain rulesets:

- Tags being present
- Tags having certain values
- File type

Audio files can be converted to a chosen lossy format using ffmpeg if desired to save space, e.g. on a mobile device. This can be done to all files or just losslessly compressed ones. You can also choose to apply ReplayGain volume adjustment if the device you're using doesn't support ReplayGain tags. Once you've made your synced directory, you can use [any folder syncing application] to copy it to a mobile device, for example.
Audio files can be converted to a chosen lossy format using ffmpeg if desired to save space, e.g. on a mobile device. This can be done to all files or just losslessly compressed ones. You can also choose to apply ReplayGain volume adjustment if the device you're using doesn't support ReplayGain tags. Once you've made your synced directory, you can use [any directory syncing application] to copy it to a mobile device, for example.

![Create New Sync](/Screenshots/Create%20New%20Sync%20Window.png?raw=true "Create New Sync Window")

Music Folder Syncer will run quietly in the background watching your chosen source directory for changes, and it will update all of your sync directories on-the-fly.
Music Directory Syncer will run quietly in the background watching your chosen source directory for changes, and it will update all of your sync directories on-the-fly.

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job.)


[any folder syncing application]: <https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.lite>
[any directory syncing application]: <https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.lite>


4 changes: 2 additions & 2 deletions Resources/Codecs.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<MusicFolderSyncer>
<MusicDirectorySyncer>
<Codecs>
<Codec>
<Name>OGG</Name>
Expand Down Expand Up @@ -86,4 +86,4 @@
</Profiles>
</Codec>
</Codecs>
</MusicFolderSyncer>
</MusicDirectorySyncer>
4 changes: 2 additions & 2 deletions Resources/DefaultSettings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<MusicFolderSyncer>
<MusicDirectorySyncer>
<ffmpegPath>C:\Program Files\ffmpeg\ffmpeg.exe</ffmpegPath>
<!--<SourceDirectory>P:\Audio\Music</SourceDirectory>-->
<LogLevel>Information</LogLevel>
Expand Down Expand Up @@ -30,4 +30,4 @@
</Encoder>
</SyncSetting>
</SyncSettings>
</MusicFolderSyncer>
</MusicDirectorySyncer>
4 changes: 2 additions & 2 deletions Resources/SyncSettings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<MusicFolderSyncer>
<MusicDirectorySyncer>
<EnableSync />
<SourceDirectory>\\hda\Audio\Music</SourceDirectory>
<ffmpegPath>C:\Program Files\ffmpeg\ffmpeg.exe</ffmpegPath>
Expand Down Expand Up @@ -60,4 +60,4 @@
</Encoder>
</SyncSetting>
</SyncSettings>
</MusicFolderSyncer>
</MusicDirectorySyncer>
48 changes: 24 additions & 24 deletions src/File Parser/FileParser.vb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#Region " Namespaces "
Imports MusicFolderSyncer.Logger.LogLevel
Imports MusicFolderSyncer.Toolkit
Imports MusicFolderSyncer.SyncSettings
Imports MusicFolderSyncer.Codec.CodecType
Imports MusicFolderSyncer.SyncSettings.TranscodeMode
Imports MusicDirectorySyncer.Logger.LogLevel
Imports MusicDirectorySyncer.Toolkit
Imports MusicDirectorySyncer.SyncSettings
Imports MusicDirectorySyncer.Codec.CodecType
Imports MusicDirectorySyncer.SyncSettings.TranscodeMode
Imports System.IO
Imports System.Environment
Imports System.Security.AccessControl
Expand All @@ -18,9 +18,9 @@ Class FileParser
Private Const FileTimeout As Int32 = 60
ReadOnly Property FilePath As String
Private ReadOnly HaveFileLock As Boolean
Private MyGlobalSyncSettings As GlobalSyncSettings
Private ReadOnly MyGlobalSyncSettings As GlobalSyncSettings
Private ReadOnly SyncSettings As SyncSettings()
Private SourceFileStream As FileStream = Nothing
Private ReadOnly SourceFileStream As FileStream = Nothing
Private ReadOnly DirectoryAccessPermissions As DirectorySecurity

#Region " New "
Expand Down Expand Up @@ -58,8 +58,8 @@ Class FileParser
End If
End Sub

#Region " Transfer File To Sync Folder "
Public Function DeleteInSyncFolder(Optional QuietMode As Boolean = False) As ReturnObject
#Region " Transfer File To Sync Directory "
Public Function DeleteInSyncDirectory(Optional QuietMode As Boolean = False) As ReturnObject

Dim MyReturnObject As ReturnObject

Expand All @@ -76,12 +76,12 @@ Class FileParser
SyncFilePath = TranscodedFilePath
End If

'Delete file if it exists in sync folder
'Delete file if it exists in sync directory
If File.Exists(SyncFilePath) Then
File.Delete(SyncFilePath)
MyLog.Write(ProcessID, "...file in sync folder deleted: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
MyLog.Write(ProcessID, "...file in sync directory deleted: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
Else
MyLog.Write(ProcessID, "...file doesn't exist in sync folder: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
MyLog.Write(ProcessID, "...file doesn't exist in sync directory: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
End If

'Delete parent directory if there are no more files in it
Expand Down Expand Up @@ -112,12 +112,12 @@ Class FileParser
If Directory.Exists(DirName) AndAlso Not Directory.EnumerateFileSystemEntries(DirName).Any() Then
Dim ParentDir As DirectoryInfo = Directory.GetParent(DirName)
Directory.Delete(DirName)
MyLog.Write(ProcessID, "...empty parent directory in sync folder deleted: """ & DirName.Substring(SyncDirectoryLength) & """.", Debug)
MyLog.Write(ProcessID, "...empty parent directory in sync directory deleted: """ & DirName.Substring(SyncDirectoryLength) & """.", Debug)
RecursiveDeleteEmptyDirectory(ParentDir.ToString, SyncDirectoryLength)
End If
End Sub

Public Function DeleteDirectoryInSyncFolder() As ReturnObject
Public Function DeleteDirectoryInSyncDirectory() As ReturnObject

Dim MyReturnObject As ReturnObject

Expand All @@ -126,12 +126,12 @@ Class FileParser
'File was meant to be synced, which means we now need to delete the synced version
Dim SyncFilePath As String = SyncSetting.SyncDirectory & FilePath.Substring(MyGlobalSyncSettings.SourceDirectory.Length)

'Delete file if it exists in sync folder
'Delete file if it exists in sync directory
If Directory.Exists(SyncFilePath) Then
Directory.Delete(SyncFilePath, True)
MyLog.Write(ProcessID, "...directory in sync folder deleted: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
MyLog.Write(ProcessID, "...directory in sync directory deleted: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
Else
MyLog.Write(ProcessID, "...directory doesn't exist in sync folder: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
MyLog.Write(ProcessID, "...directory doesn't exist in sync directory: """ & SyncFilePath.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
End If
Next

Expand All @@ -146,7 +146,7 @@ Class FileParser

End Function

Public Function TransferToSyncFolder() As ReturnObject
Public Function TransferToSyncDirectory() As ReturnObject

Dim MyReturnObject As ReturnObject

Expand Down Expand Up @@ -176,7 +176,7 @@ Class FileParser

Dim NewFile As New FileInfo(SyncFilePath)
NewFilesSize += NewFile.Length
MyLog.Write(ProcessID, "...successfully added file to sync folder...", Debug)
MyLog.Write(ProcessID, "...successfully added file to sync directory...", Debug)
End If
Else
MyLog.Write(ProcessID, "Ignoring file: """ & FilePath.Substring(MyGlobalSyncSettings.SourceDirectory.Length) & """", Information)
Expand All @@ -194,7 +194,7 @@ Class FileParser

End Function

Public Function RenameInSyncFolder(OldFilePath As String) As ReturnObject
Public Function RenameInSyncDirectory(OldFilePath As String) As ReturnObject

Dim MyReturnObject As ReturnObject

Expand All @@ -220,16 +220,16 @@ Class FileParser
Dim DirName = Path.GetDirectoryName(SyncFilePath)
If Not Directory.Exists(DirName) Then Directory.CreateDirectory(DirName, DirectoryAccessPermissions)
File.Move(OldSyncFilePath, SyncFilePath)
MyLog.Write(ProcessID, "...successfully renamed file in sync folder.", Debug)
MyLog.Write(ProcessID, "...successfully renamed file in sync directory.", Debug)

'Delete folder if there are no more files in it
'Delete directory if there are no more files in it
Dim OldDirName = Path.GetDirectoryName(OldSyncFilePath)
If Directory.Exists(OldDirName) AndAlso Directory.GetFiles(OldDirName, "*", SearchOption.AllDirectories).Length = 0 Then
Directory.Delete(OldDirName)
MyLog.Write(ProcessID, "...old parent directory is now empty so was deleted: """ & OldDirName.Substring(SyncSetting.SyncDirectory.Length) & """.", Debug)
End If
Else
MyLog.Write(ProcessID, "...old file doesn't exist in sync folder: """ & OldSyncFilePath & """, creating now...", Warning)
MyLog.Write(ProcessID, "...old file doesn't exist in sync directory: """ & OldSyncFilePath & """, creating now...", Warning)

If SyncSetting.TranscodeSetting = All OrElse (SyncSetting.TranscodeSetting = LosslessOnly AndAlso FileCodec.CompressionType = Lossless) Then 'Need to transcode file
MyLog.Write(ProcessID, "...transcoding file to " & SyncSetting.Encoder.Name & "...", Debug)
Expand All @@ -246,7 +246,7 @@ Class FileParser
If Not Result.Success Then Throw New Exception(Result.ErrorMessage)
End If

MyLog.Write(ProcessID, "...successfully added file to sync folder.", Debug)
MyLog.Write(ProcessID, "...successfully added file to sync directory.", Debug)
End If
End If
Else
Expand Down
Loading

0 comments on commit bfe99e5

Please sign in to comment.