From 2e48f0e818e18c0aaa85544efe17719783e468a6 Mon Sep 17 00:00:00 2001 From: flare561 Date: Mon, 23 Jan 2017 00:46:47 -0600 Subject: [PATCH] Add project files. --- Rippy.sln | 22 ++ Rippy/AlbumData.cs | 104 +++++++++ Rippy/App.config | 36 +++ Rippy/App.xaml | 9 + Rippy/App.xaml.cs | 17 ++ Rippy/AppSettings.cs | 33 +++ Rippy/HelperMethods.cs | 34 +++ Rippy/MainWindow.xaml | 307 +++++++++++++++++++++++++ Rippy/MainWindow.xaml.cs | 257 +++++++++++++++++++++ Rippy/Properties/AssemblyInfo.cs | 55 +++++ Rippy/Properties/Resources.Designer.cs | 73 ++++++ Rippy/Properties/Resources.resx | 124 ++++++++++ Rippy/Properties/Settings.Designer.cs | 90 ++++++++ Rippy/Properties/Settings.settings | 25 ++ Rippy/Resources/rippy.ico | Bin 0 -> 9428 bytes Rippy/Rippy.csproj | 181 +++++++++++++++ Rippy/Settings.cs | 43 ++++ Rippy/SourcedTorrentCreator.cs | 40 ++++ Rippy/packages.config | 6 + Rippy/rippy.ico | Bin 0 -> 9428 bytes 20 files changed, 1456 insertions(+) create mode 100644 Rippy.sln create mode 100644 Rippy/AlbumData.cs create mode 100644 Rippy/App.config create mode 100644 Rippy/App.xaml create mode 100644 Rippy/App.xaml.cs create mode 100644 Rippy/AppSettings.cs create mode 100644 Rippy/HelperMethods.cs create mode 100644 Rippy/MainWindow.xaml create mode 100644 Rippy/MainWindow.xaml.cs create mode 100644 Rippy/Properties/AssemblyInfo.cs create mode 100644 Rippy/Properties/Resources.Designer.cs create mode 100644 Rippy/Properties/Resources.resx create mode 100644 Rippy/Properties/Settings.Designer.cs create mode 100644 Rippy/Properties/Settings.settings create mode 100644 Rippy/Resources/rippy.ico create mode 100644 Rippy/Rippy.csproj create mode 100644 Rippy/Settings.cs create mode 100644 Rippy/SourcedTorrentCreator.cs create mode 100644 Rippy/packages.config create mode 100644 Rippy/rippy.ico diff --git a/Rippy.sln b/Rippy.sln new file mode 100644 index 0000000..992f7fd --- /dev/null +++ b/Rippy.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25123.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rippy", "Rippy\Rippy.csproj", "{F925785B-E92E-4AE4-A651-054D665B3883}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F925785B-E92E-4AE4-A651-054D665B3883}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F925785B-E92E-4AE4-A651-054D665B3883}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F925785B-E92E-4AE4-A651-054D665B3883}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F925785B-E92E-4AE4-A651-054D665B3883}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Rippy/AlbumData.cs b/Rippy/AlbumData.cs new file mode 100644 index 0000000..d600516 --- /dev/null +++ b/Rippy/AlbumData.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rippy +{ + class AlbumData : INotifyPropertyChanged + { + private string _artist; + private string _album; + private string _year; + private string _publisher; + private string _number; + private string _flacFolder; + private string _medium; + private string _tracker; + + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged(string name) + { + if (name != "MP3320") + OnPropertyChanged("MP3320"); + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + public string FlacFolder + { + get { return _flacFolder; } + set { _flacFolder = value; OnPropertyChanged("FlacFolder");} + } + + public string Artist + { + get { return _artist; } + set { _artist = value; OnPropertyChanged("Artist"); } + } + public string Album + { + get { return _album; } + set { _album = value; OnPropertyChanged("Album"); } + } + public string Year + { + get { return _year; } + set { _year = value; OnPropertyChanged("Year"); } + } + public string Publisher + { + get { return _publisher; } + set { _publisher = value; OnPropertyChanged("Publisher"); } + } + public string Number + { + get { return _number; } + set { _number = value; OnPropertyChanged("Number"); } + } + + public string Medium + { + get { return _medium; } + set { _medium = value; OnPropertyChanged("Medium"); } + } + + public string Tracker + { + get { return _tracker; } + set { _tracker = value; OnPropertyChanged("Tracker"); } + } + + public string MP3320 + { + get { return FormatFolderName("MP3 320"); } + } + + public string MP3V0 + { + get { return FormatFolderName("MP3 V0"); } + } + + public string MP3V2 + { + get + { return FormatFolderName("MP3 V2"); } + } + + public string FLAC + { + get + { return FormatFolderName("FLAC"); } + } + + private string FormatFolderName(string format) + { + if (!string.IsNullOrWhiteSpace(Publisher) || !string.IsNullOrWhiteSpace(Number)) + return $"{Artist} - {Album} ({Year}) [{Publisher} {Number}] [{Medium} {format}]"; + else + return $"{Artist} - {Album} ({Year}) [{Medium} {format}]"; + } + } +} diff --git a/Rippy/App.config b/Rippy/App.config new file mode 100644 index 0000000..06d87c3 --- /dev/null +++ b/Rippy/App.config @@ -0,0 +1,36 @@ + + + + +
+ + + + + + + + + C:\Program Files\dBpoweramp\coreconverter.exe + + + C:\Program Files (x86)\Mp3tag\Mp3tag.exe + + + .\Transcodes\ + + + .\Torrents\ + + + + + https://example.com/stuff/announce + https://example2.com/stuff2/announce + + + + + + \ No newline at end of file diff --git a/Rippy/App.xaml b/Rippy/App.xaml new file mode 100644 index 0000000..fc1cd86 --- /dev/null +++ b/Rippy/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Rippy/App.xaml.cs b/Rippy/App.xaml.cs new file mode 100644 index 0000000..86e9551 --- /dev/null +++ b/Rippy/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace Rippy +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Rippy/AppSettings.cs b/Rippy/AppSettings.cs new file mode 100644 index 0000000..378cab7 --- /dev/null +++ b/Rippy/AppSettings.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Script.Serialization; + +namespace Rippy +{ + public class AppSettings where T : new() + { + private const string DEFAULT_FILENAME = "settings.json"; + + public void Save(string fileName = DEFAULT_FILENAME) + { + File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(this)); + } + + public static void Save(T pSettings, string fileName = DEFAULT_FILENAME) + { + File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(pSettings)); + } + + public static T Load(string fileName = DEFAULT_FILENAME) + { + T t = new T(); + if (File.Exists(fileName)) + t = (new JavaScriptSerializer()).Deserialize(File.ReadAllText(fileName)); + return t; + } + } +} diff --git a/Rippy/HelperMethods.cs b/Rippy/HelperMethods.cs new file mode 100644 index 0000000..f8d7816 --- /dev/null +++ b/Rippy/HelperMethods.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rippy +{ + class HelperMethods + { + public static Task RunProcessAsync(string fileName, string arguments) + { + // there is no non-generic TaskCompletionSource + var tcs = new TaskCompletionSource(); + + var process = new Process + { + StartInfo = { FileName = fileName, Arguments = arguments }, + EnableRaisingEvents = true + }; + + process.Exited += (sender, args) => + { + tcs.SetResult(true); + process.Dispose(); + }; + + process.Start(); + + return tcs.Task; + } + } +} diff --git a/Rippy/MainWindow.xaml b/Rippy/MainWindow.xaml new file mode 100644 index 0000000..7eb14a2 --- /dev/null +++ b/Rippy/MainWindow.xaml @@ -0,0 +1,307 @@ + + + + + + + + + + + +