-
Notifications
You must be signed in to change notification settings - Fork 3
/
ChapterGrabber.cs
38 lines (32 loc) · 1.18 KB
/
ChapterGrabber.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JarrettVance.ChapterTools
{
public abstract class ChapterGrabber
{
public static List<ChapterGrabber> Grabbers = new List<ChapterGrabber> { new Grabbers.TagChimpGrabber(), new Grabbers.DatabaseGrabber() };
public abstract void PopulateNames(SearchResult result, ChapterInfo chapterInfo, bool includeDurations);
public abstract void PopulateNames(string hash, ChapterInfo chapterInfo);
public abstract List<SearchResult> Search(ChapterInfo chapterInfo);
public abstract void Upload(ChapterInfo chapterInfo);
public bool SupportsHash { get; set; }
public bool SupportsUpload { get; set; }
public event EventHandler SearchComplete;
protected void OnSearchComplete()
{
if (SearchComplete != null) SearchComplete(this, EventArgs.Empty);
}
}
public class SearchResult
{
public string Id { get; set; }
public string Name { get; set; }
public int Relevance { get; set; }
public TimeSpan Duration { get; set; }
public int Count { get; set; }
public string Type { get; set; }
public bool? HasNames { get; set; }
}
}