new_version_init

This commit is contained in:
2024-02-13 02:59:40 +01:00
Unverified
parent e36c1404ee
commit 91f9b645bd
352 changed files with 6777 additions and 8326 deletions

View 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
}
}

View 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
}
}

View 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,
}
}

View 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();
}
}
}

View 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);
}
}

View 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
}
}

View 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
View 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
}
}

View 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
}
}

View 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
}
}