new_version_init
This commit is contained in:
13
VDownload.Common/AudioExtension.cs
Normal file
13
VDownload.Common/AudioExtension.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public enum AudioExtension
|
||||
{
|
||||
MP3
|
||||
}
|
||||
}
|
||||
21
VDownload.Common/Exceptions/MediaSearchException.cs
Normal file
21
VDownload.Common/Exceptions/MediaSearchException.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common.Exceptions
|
||||
{
|
||||
public class MediaSearchException : Exception
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public MediaSearchException() : base() { }
|
||||
|
||||
public MediaSearchException(string message) : base(message) { }
|
||||
|
||||
public MediaSearchException(string message, Exception inner) : base(message, inner) { }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
21
VDownload.Common/MediaType.cs
Normal file
21
VDownload.Common/MediaType.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public enum MediaType
|
||||
{
|
||||
[Description("Original")]
|
||||
Original,
|
||||
|
||||
[Description("Only video")]
|
||||
OnlyVideo,
|
||||
|
||||
[Description("Only audio")]
|
||||
OnlyAudio,
|
||||
}
|
||||
}
|
||||
24
VDownload.Common/Playlist.cs
Normal file
24
VDownload.Common/Playlist.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VDownload.Common.Models;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public abstract class Playlist : ObservableObject, IEnumerable<Video>
|
||||
{
|
||||
public IEnumerator<Video> GetEnumerator()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
VDownload.Common/Services/ISourceSearchService.cs
Normal file
15
VDownload.Common/Services/ISourceSearchService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VDownload.Common.Models;
|
||||
|
||||
namespace VDownload.Common.Services
|
||||
{
|
||||
public interface ISourceSearchService
|
||||
{
|
||||
Task<Video> SearchVideo(string url);
|
||||
Task<Playlist> SearchPlaylist(string url, int maxVideoCount);
|
||||
}
|
||||
}
|
||||
13
VDownload.Common/Source.cs
Normal file
13
VDownload.Common/Source.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public enum Source
|
||||
{
|
||||
Twitch
|
||||
}
|
||||
}
|
||||
13
VDownload.Common/VDownload.Common.csproj
Normal file
13
VDownload.Common/VDownload.Common.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
58
VDownload.Common/Video.cs
Normal file
58
VDownload.Common/Video.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common.Models
|
||||
{
|
||||
public abstract partial class Video : ObservableObject
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[ObservableProperty]
|
||||
protected string _title;
|
||||
|
||||
[ObservableProperty]
|
||||
protected string _description;
|
||||
|
||||
[ObservableProperty]
|
||||
protected string _author;
|
||||
|
||||
[ObservableProperty]
|
||||
protected DateTime _publishDate;
|
||||
|
||||
[ObservableProperty]
|
||||
protected TimeSpan _duration;
|
||||
|
||||
[ObservableProperty]
|
||||
protected int _viewCount;
|
||||
|
||||
[ObservableProperty]
|
||||
protected string? _thumbnailUrl;
|
||||
|
||||
[ObservableProperty]
|
||||
protected ObservableCollection<VideoStream> _streams;
|
||||
|
||||
[ObservableProperty]
|
||||
protected string _url;
|
||||
|
||||
[ObservableProperty]
|
||||
protected Source _source;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
protected Video()
|
||||
{
|
||||
_streams = new ObservableCollection<VideoStream>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
13
VDownload.Common/VideoExtension.cs
Normal file
13
VDownload.Common/VideoExtension.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public enum VideoExtension
|
||||
{
|
||||
MP4
|
||||
}
|
||||
}
|
||||
22
VDownload.Common/VideoStream.cs
Normal file
22
VDownload.Common/VideoStream.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Common
|
||||
{
|
||||
public abstract partial class VideoStream : ObservableObject
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[ObservableProperty]
|
||||
protected string _streamIdentifier;
|
||||
|
||||
[ObservableProperty]
|
||||
private int _width;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user