Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ember.Plugins: Implement movie image scraper.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
- Loading branch information
Andrew Fyfe
committed
Sep 6, 2012
1 parent
f93081f
commit 8fa5450
Showing
6 changed files
with
225 additions
and
4 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
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 |
---|---|---|
@@ -1,9 +1,68 @@ | ||
namespace Ember.Plugins.Scraper | ||
using EmberAPI; | ||
|
||
namespace Ember.Plugins.Scraper | ||
{ | ||
/// <summary> | ||
/// Defines a movie image scraper. | ||
/// </summary> | ||
public interface IMovieImageScraper | ||
{ | ||
|
||
/// <summary> | ||
/// Scrapes the movie posters. | ||
/// </summary> | ||
/// <param name="context">The context.</param> | ||
/// <returns></returns> | ||
PluginActionResult ScrapeMovieImage(MovieImageScraperActionContext context); | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Context for a movie image scraper action. | ||
/// </summary> | ||
public class MovieImageScraperActionContext | ||
: ImageScrapeActionContext | ||
{ | ||
|
||
#region Fields | ||
|
||
private Structures.DBMovie dbMovie; | ||
|
||
#endregion Fields | ||
|
||
|
||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets the movie. | ||
/// </summary> | ||
public Structures.DBMovie DBMovie | ||
{ | ||
get { return dbMovie; } | ||
} | ||
|
||
#endregion Properties | ||
|
||
|
||
#region Constructor | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MovieImageScraperActionContext"/> class. | ||
/// </summary> | ||
/// <param name="dbMovie">The movie.</param> | ||
/// <param name="scrapeType">The type of scrape to perform.</param> | ||
/// <param name="askIfMultipleResults">if set to <c>true</c> ask the user to select a movie if multiple results are found.</param> | ||
public MovieImageScraperActionContext( | ||
Structures.DBMovie dbMovie, | ||
ImageScrapeType imageScrapeType, | ||
ScrapeType scrapeType, | ||
bool askIfMultipleResults) | ||
: base(imageScrapeType, scrapeType, askIfMultipleResults) | ||
{ | ||
this.dbMovie = dbMovie; | ||
} | ||
|
||
#endregion Constructor | ||
|
||
} | ||
} |
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,72 @@ | ||
namespace Ember.Plugins.Scraper | ||
{ | ||
|
||
/// <summary> | ||
/// The type of image scrape to perform. | ||
/// </summary> | ||
public enum ImageScrapeType | ||
{ | ||
/// <summary> | ||
/// Scrape a poster. | ||
/// </summary> | ||
Poster, | ||
|
||
/// <summary> | ||
/// Scrape fanart. | ||
/// </summary> | ||
Fanart, | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Context for image scraper actions. | ||
/// </summary> | ||
public class ImageScrapeActionContext | ||
: ScraperActionContext | ||
{ | ||
|
||
#region Fields | ||
|
||
private ImageScrapeType imageScrapeType; | ||
|
||
#endregion Fields | ||
|
||
|
||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets the type of image scrape to perform. | ||
/// </summary> | ||
/// <value> | ||
/// The type of image scrape to perform. | ||
/// </value> | ||
public ImageScrapeType ImageScrapeType | ||
{ | ||
get { return imageScrapeType; } | ||
} | ||
|
||
#endregion Properties | ||
|
||
|
||
#region Constructor | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ImageScrapeActionContext"/> class. | ||
/// </summary> | ||
/// <param name="imageScrapeType">Type of the image scrape.</param> | ||
/// <param name="scrapeType">Type of the scrape.</param> | ||
/// <param name="askIfMultipleResults">if set to <c>true</c> [ask if multiple results].</param> | ||
public ImageScrapeActionContext( | ||
ImageScrapeType imageScrapeType, | ||
ScrapeType scrapeType, | ||
bool askIfMultipleResults) | ||
: base(scrapeType, askIfMultipleResults) | ||
{ | ||
this.imageScrapeType = imageScrapeType; | ||
} | ||
|
||
#endregion Constructor | ||
|
||
} | ||
|
||
} |
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