C# Class WhatCD.Api

Provides a user-friendly interface to the WhatCD JSON API.
Home: https://github.com/frankston/WhatAPI JSON API Reference: https://github.com/WhatCD/Gazelle/wiki/JSON-API-Documentation
Inheritance: IDisposable
Mostrar archivo Open project: frankston/WhatAPI Class Usage Examples

Private Properties

Property Type Description
GetTorrent WhatCD.Model.ActionTorrent.Torrent

Public Methods

Method Description
Api ( string username, string password, bool errorOnMissingMember = false ) : System

Logs the user on to what.cd.

Dispose ( ) : void

Logs off the current session.

DownloadTorrent ( int torrentID ) : Torrent

Downloads the torrent file.

GenerateTorrentDownloadUri ( int torrentID ) : Uri

GetAnnouncements ( ) : Announcements

Gets the most recent announcements and blog posts.

GetArtist ( int artistID ) : WhatCD.Model.ActionArtist.Artist

Gets artist information.

GetArtist ( string artistName ) : WhatCD.Model.ActionArtist.Artist

Gets artist information.

GetBookmarksArtists ( ) : BookmarksArtists

Gets artist bookmarks.

GetBookmarksTorrents ( ) : BookmarksTorrents

Gets torrent bookmarks.

GetBrowse ( ISearchTorrents options ) : Browse

Searches torrents.

GetCollage ( int collageID ) : Collage

Gets information about a particular collage.

GetFlacLogScore ( string log ) : int

Determines the rip log score out of 100.

GetForumMain ( ) : ForumMain

Gets all forum categories.

GetForumViewForum ( int forumID, int page ) : ForumViewForum

Gets a page of threads from a forum.

GetForumViewThread ( int postID ) : ForumViewThread

Gets a page of forum thread posts where a specific thread exists.

GetForumViewThread ( int threadID, int page ) : ForumViewThread

Gets a specific page of forum thread posts.

GetInbox ( IInbox options ) : Inbox

Searches the contents of messages from either inbox or sentbox.

GetInboxViewConv ( int conversationID ) : InboxViewConv

Gets all messages from a conversation.

GetIndex ( ) : Index

Gets information about the current user.

GetNotifications ( int page ) : WhatCD.Model.ActionNotifications.Notifications

Gets notifications.

GetRecords ( ) : Records

Obtains the maximum uptime records for the site, tracker, and irc (hours).

GetRequest ( IGetRequest options ) : WhatCD.Model.ActionRequest.Request

Gets information about a specific request.

GetRequests ( ISearchRequests options ) : Requests

Searches requests. If no arguments are specified then the most recent requests are shown.

GetSimilarArtists ( int artistID, int limit ) : SimilarArtists

Gets similar artists. Note: the return response from the server does not conform to the standard JSON response pattern.

GetStatus ( ) : Status

Determines if the site, tracker, and irc are online.

GetSubscriptions ( bool onlyShowUnread ) : Subscriptions

Get forum scriptions.

GetTop10Tags ( int limit ) : Top10Tags

Gets the top tags.

GetTop10Torrents ( int limit ) : Top10Torrents

Gets the top torrents.

GetTop10Users ( int limit ) : Top10Users

Gets the top users.

GetTorrent ( int id ) : WhatCD.Model.ActionTorrent.Torrent

Gets information about a particular torrent.

GetTorrent ( string hash ) : WhatCD.Model.ActionTorrent.Torrent

Gets information about a particular torrent.

GetTorrentGroup ( int groupID ) : TorrentGroup

Gets a torrent group.

GetUptime ( ) : Uptime

Obtains the current site, tracker, and irc uptime (hours).

GetUser ( int userID ) : User

Gets user information.

GetUserSearch ( string searchTerm, int page ) : UserSearch

Searches for users.

SessionIsValid ( ) : bool

Verifies the current logged-on session is valid.

Private Methods

Method Description
GetTorrent ( QueryBuilder builder ) : WhatCD.Model.ActionTorrent.Torrent

Gets information about a particular torrent.

Method Details

Api() public method

Logs the user on to what.cd.
public Api ( string username, string password, bool errorOnMissingMember = false ) : System
username string What.cd username.
password string What.cd password.
errorOnMissingMember bool If set to true then the deserialization process will raise an exception if any JSON members exist that do not exist in the model data.
return System

Dispose() public method

Logs off the current session.
public Dispose ( ) : void
return void

DownloadTorrent() public method

Downloads the torrent file.
public DownloadTorrent ( int torrentID ) : Torrent
torrentID int The ID of the torrent to download. Mandatory.
return Torrent

GenerateTorrentDownloadUri() public method

public GenerateTorrentDownloadUri ( int torrentID ) : Uri
torrentID int
return System.Uri

GetAnnouncements() public method

Gets the most recent announcements and blog posts.
public GetAnnouncements ( ) : Announcements
return Announcements

GetArtist() public method

Gets artist information.
public GetArtist ( int artistID ) : WhatCD.Model.ActionArtist.Artist
artistID int Artist ID. Mandatory.
return WhatCD.Model.ActionArtist.Artist

GetArtist() public method

Gets artist information.
public GetArtist ( string artistName ) : WhatCD.Model.ActionArtist.Artist
artistName string Artist Name. Mandatory.
return WhatCD.Model.ActionArtist.Artist

GetBookmarksArtists() public method

Gets artist bookmarks.
public GetBookmarksArtists ( ) : BookmarksArtists
return BookmarksArtists

GetBookmarksTorrents() public method

Gets torrent bookmarks.
public GetBookmarksTorrents ( ) : BookmarksTorrents
return BookmarksTorrents

GetBrowse() public method

Searches torrents.
public GetBrowse ( ISearchTorrents options ) : Browse
options ISearchTorrents Object that inherits from ISearchTorrents.
return Browse

GetCollage() public method

Gets information about a particular collage.
public GetCollage ( int collageID ) : Collage
collageID int Collage ID. Mandatory.
return Collage

GetFlacLogScore() public method

Determines the rip log score out of 100.
public GetFlacLogScore ( string log ) : int
log string Log file contents.
return int

GetForumMain() public method

Gets all forum categories.
public GetForumMain ( ) : ForumMain
return ForumMain

GetForumViewForum() public method

Gets a page of threads from a forum.
public GetForumViewForum ( int forumID, int page ) : ForumViewForum
forumID int Forum ID. Mandatory.
page int Page number. Optional.
return ForumViewForum

GetForumViewThread() public method

Gets a page of forum thread posts where a specific thread exists.
public GetForumViewThread ( int postID ) : ForumViewThread
postID int Post ID. Mandatory.
return ForumViewThread

GetForumViewThread() public method

Gets a specific page of forum thread posts.
public GetForumViewThread ( int threadID, int page ) : ForumViewThread
threadID int Thread ID. Mandatory.
page int Page number. Optional.
return ForumViewThread

GetInbox() public method

Searches the contents of messages from either inbox or sentbox.
public GetInbox ( IInbox options ) : Inbox
options IInbox Object implementing the IInbox interface.
return Inbox

GetInboxViewConv() public method

Gets all messages from a conversation.
public GetInboxViewConv ( int conversationID ) : InboxViewConv
conversationID int Conversation ID. Mandatory.
return InboxViewConv

GetIndex() public method

Gets information about the current user.
public GetIndex ( ) : Index
return Index

GetNotifications() public method

Gets notifications.
public GetNotifications ( int page ) : WhatCD.Model.ActionNotifications.Notifications
page int Notification page number. Optional.
return WhatCD.Model.ActionNotifications.Notifications

GetRecords() public method

Obtains the maximum uptime records for the site, tracker, and irc (hours).
public GetRecords ( ) : Records
return WhatCD.Model.WhatStatus.Records

GetRequest() public method

Gets information about a specific request.
public GetRequest ( IGetRequest options ) : WhatCD.Model.ActionRequest.Request
options IGetRequest Object that inherits IGetRequest
return WhatCD.Model.ActionRequest.Request

GetRequests() public method

Searches requests. If no arguments are specified then the most recent requests are shown.
public GetRequests ( ISearchRequests options ) : Requests
options ISearchRequests Object that inherits ISearchRequests.
return Requests

GetSimilarArtists() public method

Gets similar artists. Note: the return response from the server does not conform to the standard JSON response pattern.
public GetSimilarArtists ( int artistID, int limit ) : SimilarArtists
artistID int Artist ID. Mandatory.
limit int Maximum result limit. Mandatory.
return WhatCD.Model.ActionSimilarArtists.SimilarArtists

GetStatus() public method

Determines if the site, tracker, and irc are online.
public GetStatus ( ) : Status
return WhatCD.Model.WhatStatus.Status

GetSubscriptions() public method

Get forum scriptions.
public GetSubscriptions ( bool onlyShowUnread ) : Subscriptions
onlyShowUnread bool Only show subscribed forums with unread threads. Optional.
return Subscriptions

GetTop10Tags() public method

Gets the top tags.
public GetTop10Tags ( int limit ) : Top10Tags
limit int Maximum result limit. Acceptable values: 10, 25, 100, and 250. Optional. Default is 25.
return Top10Tags

GetTop10Torrents() public method

Gets the top torrents.
public GetTop10Torrents ( int limit ) : Top10Torrents
limit int Maximum result limit. Acceptable values: 10, 25, 100, and 250. Optional. Default is 25.
return Top10Torrents

GetTop10Users() public method

Gets the top users.
public GetTop10Users ( int limit ) : Top10Users
limit int Maximum result limit. Acceptable values: 10, 25, 100, and 250. Optional. Default is 25.
return Top10Users

GetTorrent() public method

Gets information about a particular torrent.
public GetTorrent ( int id ) : WhatCD.Model.ActionTorrent.Torrent
id int ID of torrent. Mandatory.
return WhatCD.Model.ActionTorrent.Torrent

GetTorrent() public method

Gets information about a particular torrent.
public GetTorrent ( string hash ) : WhatCD.Model.ActionTorrent.Torrent
hash string Hash of torrent. Mandatory.
return WhatCD.Model.ActionTorrent.Torrent

GetTorrentGroup() public method

Gets a torrent group.
public GetTorrentGroup ( int groupID ) : TorrentGroup
groupID int Group ID. Mandatory.
return TorrentGroup

GetUptime() public method

Obtains the current site, tracker, and irc uptime (hours).
public GetUptime ( ) : Uptime
return WhatCD.Model.WhatStatus.Uptime

GetUser() public method

Gets user information.
public GetUser ( int userID ) : User
userID int User ID. Mandatory.
return User

GetUserSearch() public method

Searches for users.
public GetUserSearch ( string searchTerm, int page ) : UserSearch
searchTerm string String to search for. Mandatory.
page int Results page number. Optional.
return UserSearch

SessionIsValid() public method

Verifies the current logged-on session is valid.
public SessionIsValid ( ) : bool
return bool