-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from CodesDoWork/MoreMetadataFlexibility
More metadata flexibility
- Loading branch information
Showing
21 changed files
with
383 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace MediaDownloader.Converters | ||
{ | ||
internal class BooleanToggleConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return !(bool) value; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return !(bool) value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MediaDownloader.Utils; | ||
|
||
namespace MediaDownloader.Data | ||
{ | ||
public class DownloadSettings | ||
{ | ||
public DownloadSettings() | ||
{ | ||
DownloadType.Listeners.Add(value => IsVideoDownload.Value = value == Data.DownloadType.Video); | ||
} | ||
|
||
public NotifyProperty<DownloadType> DownloadType { get; } = new(Data.DownloadType.Audio); | ||
|
||
public NotifyProperty<bool> IsVideoDownload { get; } = new(); | ||
|
||
public NotifyProperty<VideoQuality> VideoQuality { get; } = new(Data.VideoQuality.Best); | ||
|
||
public void CopyFrom(DownloadSettings downloadSettings) | ||
{ | ||
DownloadType.Value = downloadSettings.DownloadType.Value; | ||
VideoQuality.Value = downloadSettings.VideoQuality.Value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using MediaDownloader.Utils; | ||
|
||
namespace MediaDownloader.Data | ||
{ | ||
public class MetadataSettings | ||
{ | ||
public NotifyProperty<bool> SaveThumbnail { get; } = new(true); | ||
|
||
public NotifyProperty<bool> SavePlaylistAsAlbum { get; } = new(true); | ||
|
||
public void CopyFrom(MetadataSettings metadataSettings) | ||
{ | ||
SaveThumbnail.Value = metadataSettings.SaveThumbnail.Value; | ||
SavePlaylistAsAlbum.Value = metadataSettings.SavePlaylistAsAlbum.Value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Data.Entity; | ||
using static MediaDownloader.Data.DatabaseContext; | ||
|
||
namespace MediaDownloader.Data | ||
{ | ||
public class TitleModifier | ||
{ | ||
[Key] public int Id { get; set; } | ||
|
||
public string Target { get; set; } | ||
|
||
public bool IsActivated { get; set; } = true; | ||
|
||
public static ObservableCollection<TitleModifier> GetLocalSavedDownloads() | ||
{ | ||
DBConnection.TitleModifiers.Load(); | ||
return DBConnection.TitleModifiers.Local; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.