2
0

IApiClient.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. using MediaBrowser.Model.Configuration;
  2. using MediaBrowser.Model.Dto;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.Globalization;
  5. using MediaBrowser.Model.Notifications;
  6. using MediaBrowser.Model.Plugins;
  7. using MediaBrowser.Model.Querying;
  8. using MediaBrowser.Model.Serialization;
  9. using MediaBrowser.Model.Session;
  10. using MediaBrowser.Model.System;
  11. using MediaBrowser.Model.Tasks;
  12. using System;
  13. using System.Collections.Generic;
  14. using System.IO;
  15. using System.Threading.Tasks;
  16. namespace MediaBrowser.Model.ApiClient
  17. {
  18. public interface IApiClient : IDisposable
  19. {
  20. /// <summary>
  21. /// Occurs when [HTTP response received].
  22. /// </summary>
  23. event EventHandler<HttpResponseEventArgs> HttpResponseReceived;
  24. /// <summary>
  25. /// Gets the theme songs async.
  26. /// </summary>
  27. /// <param name="userId">The user id.</param>
  28. /// <param name="itemId">The item id.</param>
  29. /// <param name="inheritFromParents">if set to <c>true</c> [inherit from parents].</param>
  30. /// <returns>Task{ThemeMediaResult}.</returns>
  31. Task<ThemeMediaResult> GetThemeSongsAsync(string userId, string itemId, bool inheritFromParents);
  32. /// <summary>
  33. /// Gets the theme videos async.
  34. /// </summary>
  35. /// <param name="userId">The user id.</param>
  36. /// <param name="itemId">The item id.</param>
  37. /// <param name="inheritFromParents">if set to <c>true</c> [inherit from parents].</param>
  38. /// <returns>Task{ThemeMediaResult}.</returns>
  39. Task<ThemeMediaResult> GetThemeVideosAsync(string userId, string itemId, bool inheritFromParents);
  40. /// <summary>
  41. /// Gets all theme media async.
  42. /// </summary>
  43. /// <param name="userId">The user id.</param>
  44. /// <param name="itemId">The item id.</param>
  45. /// <param name="inheritFromParents">if set to <c>true</c> [inherit from parents].</param>
  46. /// <returns>Task{AllThemeMediaResult}.</returns>
  47. Task<AllThemeMediaResult> GetAllThemeMediaAsync(string userId, string itemId, bool inheritFromParents);
  48. /// <summary>
  49. /// Marks the notifications read.
  50. /// </summary>
  51. /// <param name="userId">The user id.</param>
  52. /// <param name="notificationIdList">The notification id list.</param>
  53. /// <param name="isRead">if set to <c>true</c> [is read].</param>
  54. /// <returns>Task.</returns>
  55. Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead);
  56. /// <summary>
  57. /// Updates the notification.
  58. /// </summary>
  59. /// <param name="notification">The notification.</param>
  60. /// <returns>Task.</returns>
  61. Task UpdateNotification(Notification notification);
  62. /// <summary>
  63. /// Adds the notification.
  64. /// </summary>
  65. /// <param name="notification">The notification.</param>
  66. /// <returns>Task{Notification}.</returns>
  67. Task<Notification> AddNotification(Notification notification);
  68. /// <summary>
  69. /// Gets the notifications summary.
  70. /// </summary>
  71. /// <param name="userId">The user id.</param>
  72. /// <returns>Task{NotificationsSummary}.</returns>
  73. Task<NotificationsSummary> GetNotificationsSummary(string userId);
  74. /// <summary>
  75. /// Gets the notifications async.
  76. /// </summary>
  77. /// <param name="query">The query.</param>
  78. /// <returns>Task{NotificationResult}.</returns>
  79. Task<NotificationResult> GetNotificationsAsync(NotificationQuery query);
  80. /// <summary>
  81. /// Gets an image stream based on a url
  82. /// </summary>
  83. /// <param name="url">The URL.</param>
  84. /// <returns>Task{Stream}.</returns>
  85. /// <exception cref="ArgumentNullException">url</exception>
  86. Task<Stream> GetImageStreamAsync(string url);
  87. /// <summary>
  88. /// Gets a BaseItem
  89. /// </summary>
  90. /// <param name="id">The id.</param>
  91. /// <param name="userId">The user id.</param>
  92. /// <returns>Task{BaseItemDto}.</returns>
  93. /// <exception cref="ArgumentNullException">id</exception>
  94. Task<BaseItemDto> GetItemAsync(string id, string userId);
  95. /// <summary>
  96. /// Gets the intros async.
  97. /// </summary>
  98. /// <param name="itemId">The item id.</param>
  99. /// <param name="userId">The user id.</param>
  100. /// <returns>Task{System.String[]}.</returns>
  101. /// <exception cref="ArgumentNullException">id</exception>
  102. Task<string[]> GetIntrosAsync(string itemId, string userId);
  103. /// <summary>
  104. /// Gets a BaseItem
  105. /// </summary>
  106. /// <param name="userId">The user id.</param>
  107. /// <returns>Task{BaseItemDto}.</returns>
  108. /// <exception cref="ArgumentNullException">userId</exception>
  109. Task<BaseItemDto> GetRootFolderAsync(string userId);
  110. /// <summary>
  111. /// Gets the users async.
  112. /// </summary>
  113. /// <returns>Task{UserDto[]}.</returns>
  114. Task<UserDto[]> GetUsersAsync(UserQuery query);
  115. /// <summary>
  116. /// Gets the public users async.
  117. /// </summary>
  118. /// <returns>Task{UserDto[]}.</returns>
  119. Task<UserDto[]> GetPublicUsersAsync();
  120. /// <summary>
  121. /// Gets active client sessions.
  122. /// </summary>
  123. /// <returns>Task{SessionInfoDto[]}.</returns>
  124. Task<SessionInfoDto[]> GetClientSessionsAsync();
  125. /// <summary>
  126. /// Gets the item counts async.
  127. /// </summary>
  128. /// <param name="userId">The user id.</param>
  129. /// <returns>Task{ItemCounts}.</returns>
  130. Task<ItemCounts> GetItemCountsAsync(string userId);
  131. /// <summary>
  132. /// Queries for items
  133. /// </summary>
  134. /// <param name="query">The query.</param>
  135. /// <returns>Task{ItemsResult}.</returns>
  136. /// <exception cref="ArgumentNullException">query</exception>
  137. Task<ItemsResult> GetItemsAsync(ItemQuery query);
  138. /// <summary>
  139. /// Gets the similar movies async.
  140. /// </summary>
  141. /// <param name="query">The query.</param>
  142. /// <returns>Task{ItemsResult}.</returns>
  143. Task<ItemsResult> GetSimilarMoviesAsync(SimilarItemsQuery query);
  144. /// <summary>
  145. /// Gets the similar series async.
  146. /// </summary>
  147. /// <param name="query">The query.</param>
  148. /// <returns>Task{ItemsResult}.</returns>
  149. Task<ItemsResult> GetSimilarSeriesAsync(SimilarItemsQuery query);
  150. /// <summary>
  151. /// Gets the similar albums async.
  152. /// </summary>
  153. /// <param name="query">The query.</param>
  154. /// <returns>Task{ItemsResult}.</returns>
  155. Task<ItemsResult> GetSimilarAlbumsAsync(SimilarItemsQuery query);
  156. /// <summary>
  157. /// Gets the similar games async.
  158. /// </summary>
  159. /// <param name="query">The query.</param>
  160. /// <returns>Task{ItemsResult}.</returns>
  161. Task<ItemsResult> GetSimilarGamesAsync(SimilarItemsQuery query);
  162. /// <summary>
  163. /// Gets the people async.
  164. /// </summary>
  165. /// <param name="query">The query.</param>
  166. /// <returns>Task{ItemsResult}.</returns>
  167. /// <exception cref="ArgumentNullException">userId</exception>
  168. Task<ItemsResult> GetPeopleAsync(PersonsQuery query);
  169. /// <summary>
  170. /// Gets the artists.
  171. /// </summary>
  172. /// <param name="query">The query.</param>
  173. /// <returns>Task{ItemsResult}.</returns>
  174. /// <exception cref="ArgumentNullException">userId</exception>
  175. Task<ItemsResult> GetArtistsAsync(ArtistsQuery query);
  176. /// <summary>
  177. /// Gets a studio
  178. /// </summary>
  179. /// <param name="name">The name.</param>
  180. /// <returns>Task{BaseItemDto}.</returns>
  181. /// <exception cref="ArgumentNullException">userId</exception>
  182. Task<BaseItemDto> GetStudioAsync(string name);
  183. /// <summary>
  184. /// Gets the next up async.
  185. /// </summary>
  186. /// <param name="query">The query.</param>
  187. /// <returns>Task{ItemsResult}.</returns>
  188. Task<ItemsResult> GetNextUpAsync(NextUpQuery query);
  189. /// <summary>
  190. /// Gets a genre
  191. /// </summary>
  192. /// <param name="name">The name.</param>
  193. /// <returns>Task{BaseItemDto}.</returns>
  194. /// <exception cref="ArgumentNullException">userId</exception>
  195. Task<BaseItemDto> GetGenreAsync(string name);
  196. /// <summary>
  197. /// Gets the artist async.
  198. /// </summary>
  199. /// <param name="name">The name.</param>
  200. /// <returns>Task{BaseItemDto}.</returns>
  201. /// <exception cref="ArgumentNullException">name</exception>
  202. Task<BaseItemDto> GetArtistAsync(string name);
  203. /// <summary>
  204. /// Restarts the server.
  205. /// </summary>
  206. /// <returns>Task.</returns>
  207. Task RestartServerAsync();
  208. /// <summary>
  209. /// Gets the system status async.
  210. /// </summary>
  211. /// <returns>Task{SystemInfo}.</returns>
  212. Task<SystemInfo> GetSystemInfoAsync();
  213. /// <summary>
  214. /// Gets a person
  215. /// </summary>
  216. /// <param name="name">The name.</param>
  217. /// <returns>Task{BaseItemDto}.</returns>
  218. /// <exception cref="ArgumentNullException">userId</exception>
  219. Task<BaseItemDto> GetPersonAsync(string name);
  220. /// <summary>
  221. /// Gets a year
  222. /// </summary>
  223. /// <param name="year">The year.</param>
  224. /// <returns>Task{BaseItemDto}.</returns>
  225. /// <exception cref="ArgumentNullException">userId</exception>
  226. Task<BaseItemDto> GetYearAsync(int year);
  227. /// <summary>
  228. /// Gets a list of plugins installed on the server
  229. /// </summary>
  230. /// <returns>Task{PluginInfo[]}.</returns>
  231. Task<PluginInfo[]> GetInstalledPluginsAsync();
  232. /// <summary>
  233. /// Gets the current server configuration
  234. /// </summary>
  235. /// <returns>Task{ServerConfiguration}.</returns>
  236. Task<ServerConfiguration> GetServerConfigurationAsync();
  237. /// <summary>
  238. /// Gets the scheduled tasks.
  239. /// </summary>
  240. /// <returns>Task{TaskInfo[]}.</returns>
  241. Task<TaskInfo[]> GetScheduledTasksAsync();
  242. /// <summary>
  243. /// Gets the scheduled task async.
  244. /// </summary>
  245. /// <param name="id">The id.</param>
  246. /// <returns>Task{TaskInfo}.</returns>
  247. /// <exception cref="ArgumentNullException">id</exception>
  248. Task<TaskInfo> GetScheduledTaskAsync(Guid id);
  249. /// <summary>
  250. /// Gets a user by id
  251. /// </summary>
  252. /// <param name="id">The id.</param>
  253. /// <returns>Task{UserDto}.</returns>
  254. /// <exception cref="ArgumentNullException">id</exception>
  255. Task<UserDto> GetUserAsync(string id);
  256. /// <summary>
  257. /// Gets the parental ratings async.
  258. /// </summary>
  259. /// <returns>Task{List{ParentalRating}}.</returns>
  260. Task<List<ParentalRating>> GetParentalRatingsAsync();
  261. /// <summary>
  262. /// Gets local trailers for an item
  263. /// </summary>
  264. /// <param name="userId">The user id.</param>
  265. /// <param name="itemId">The item id.</param>
  266. /// <returns>Task{ItemsResult}.</returns>
  267. /// <exception cref="ArgumentNullException">query</exception>
  268. Task<BaseItemDto[]> GetLocalTrailersAsync(string userId, string itemId);
  269. /// <summary>
  270. /// Gets special features for an item
  271. /// </summary>
  272. /// <param name="userId">The user id.</param>
  273. /// <param name="itemId">The item id.</param>
  274. /// <returns>Task{BaseItemDto[]}.</returns>
  275. /// <exception cref="ArgumentNullException">userId</exception>
  276. Task<BaseItemDto[]> GetSpecialFeaturesAsync(string userId, string itemId);
  277. /// <summary>
  278. /// Gets the cultures async.
  279. /// </summary>
  280. /// <returns>Task{CultureDto[]}.</returns>
  281. Task<CultureDto[]> GetCulturesAsync();
  282. /// <summary>
  283. /// Gets the countries async.
  284. /// </summary>
  285. /// <returns>Task{CountryInfo[]}.</returns>
  286. Task<CountryInfo[]> GetCountriesAsync();
  287. /// <summary>
  288. /// Marks an item as played or unplayed.
  289. /// This should not be used to update playstate following playback.
  290. /// There are separate playstate check-in methods for that. This should be used for a
  291. /// separate option to reset playstate.
  292. /// </summary>
  293. /// <param name="itemId">The item id.</param>
  294. /// <param name="userId">The user id.</param>
  295. /// <param name="wasPlayed">if set to <c>true</c> [was played].</param>
  296. /// <returns>Task.</returns>
  297. /// <exception cref="ArgumentNullException">itemId</exception>
  298. Task UpdatePlayedStatusAsync(string itemId, string userId, bool wasPlayed);
  299. /// <summary>
  300. /// Updates the favorite status async.
  301. /// </summary>
  302. /// <param name="itemId">The item id.</param>
  303. /// <param name="userId">The user id.</param>
  304. /// <param name="isFavorite">if set to <c>true</c> [is favorite].</param>
  305. /// <returns>Task.</returns>
  306. /// <exception cref="ArgumentNullException">itemId</exception>
  307. Task UpdateFavoriteStatusAsync(string itemId, string userId, bool isFavorite);
  308. /// <summary>
  309. /// Reports to the server that the user has begun playing an item
  310. /// </summary>
  311. /// <param name="itemId">The item id.</param>
  312. /// <param name="userId">The user id.</param>
  313. /// <returns>Task{UserItemDataDto}.</returns>
  314. /// <exception cref="ArgumentNullException">itemId</exception>
  315. Task ReportPlaybackStartAsync(string itemId, string userId);
  316. /// <summary>
  317. /// Reports playback progress to the server
  318. /// </summary>
  319. /// <param name="itemId">The item id.</param>
  320. /// <param name="userId">The user id.</param>
  321. /// <param name="positionTicks">The position ticks.</param>
  322. /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
  323. /// <returns>Task{UserItemDataDto}.</returns>
  324. /// <exception cref="ArgumentNullException">itemId</exception>
  325. Task ReportPlaybackProgressAsync(string itemId, string userId, long? positionTicks, bool isPaused);
  326. /// <summary>
  327. /// Reports to the server that the user has stopped playing an item
  328. /// </summary>
  329. /// <param name="itemId">The item id.</param>
  330. /// <param name="userId">The user id.</param>
  331. /// <param name="positionTicks">The position ticks.</param>
  332. /// <returns>Task{UserItemDataDto}.</returns>
  333. /// <exception cref="ArgumentNullException">itemId</exception>
  334. Task ReportPlaybackStoppedAsync(string itemId, string userId, long? positionTicks);
  335. /// <summary>
  336. /// Instructs antoher client to browse to a library item.
  337. /// </summary>
  338. /// <param name="sessionId">The session id.</param>
  339. /// <param name="itemId">The id of the item to browse to.</param>
  340. /// <param name="itemName">The name of the item to browse to.</param>
  341. /// <param name="itemType">The type of the item to browse to.</param>
  342. /// <param name="context">Optional ui context (movies, music, tv, games, etc). The client is free to ignore this.</param>
  343. /// <returns>Task.</returns>
  344. Task SendBrowseCommandAsync(string sessionId, string itemId, string itemName, string itemType, string context);
  345. /// <summary>
  346. /// Sends the playstate command async.
  347. /// </summary>
  348. /// <param name="sessionId">The session id.</param>
  349. /// <param name="request">The request.</param>
  350. /// <returns>Task.</returns>
  351. Task SendPlaystateCommandAsync(string sessionId, PlaystateRequest request);
  352. /// <summary>
  353. /// Sends the play command async.
  354. /// </summary>
  355. /// <param name="sessionId">The session id.</param>
  356. /// <param name="request">The request.</param>
  357. /// <returns>Task.</returns>
  358. /// <exception cref="ArgumentNullException">
  359. /// sessionId
  360. /// or
  361. /// request
  362. /// </exception>
  363. Task SendPlayCommandAsync(string sessionId, PlayRequest request);
  364. /// <summary>
  365. /// Clears a user's rating for an item
  366. /// </summary>
  367. /// <param name="itemId">The item id.</param>
  368. /// <param name="userId">The user id.</param>
  369. /// <returns>Task{UserItemDataDto}.</returns>
  370. /// <exception cref="ArgumentNullException">itemId</exception>
  371. Task ClearUserItemRatingAsync(string itemId, string userId);
  372. /// <summary>
  373. /// Updates a user's rating for an item, based on likes or dislikes
  374. /// </summary>
  375. /// <param name="itemId">The item id.</param>
  376. /// <param name="userId">The user id.</param>
  377. /// <param name="likes">if set to <c>true</c> [likes].</param>
  378. /// <returns>Task.</returns>
  379. /// <exception cref="ArgumentNullException">itemId</exception>
  380. Task UpdateUserItemRatingAsync(string itemId, string userId, bool likes);
  381. /// <summary>
  382. /// Authenticates a user and returns the result
  383. /// </summary>
  384. /// <param name="userId">The user id.</param>
  385. /// <param name="sha1Hash">The sha1 hash.</param>
  386. /// <returns>Task.</returns>
  387. /// <exception cref="ArgumentNullException">userId</exception>
  388. Task AuthenticateUserAsync(string userId, byte[] sha1Hash);
  389. /// <summary>
  390. /// Updates the server configuration async.
  391. /// </summary>
  392. /// <param name="configuration">The configuration.</param>
  393. /// <returns>Task.</returns>
  394. /// <exception cref="ArgumentNullException">configuration</exception>
  395. Task UpdateServerConfigurationAsync(ServerConfiguration configuration);
  396. /// <summary>
  397. /// Updates the scheduled task triggers.
  398. /// </summary>
  399. /// <param name="id">The id.</param>
  400. /// <param name="triggers">The triggers.</param>
  401. /// <returns>Task{RequestResult}.</returns>
  402. /// <exception cref="ArgumentNullException">id</exception>
  403. Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers);
  404. /// <summary>
  405. /// Gets the display preferences.
  406. /// </summary>
  407. /// <param name="id">The id.</param>
  408. /// <returns>Task{BaseItemDto}.</returns>
  409. Task<DisplayPreferences> GetDisplayPreferencesAsync(string id);
  410. /// <summary>
  411. /// Updates display preferences for a user
  412. /// </summary>
  413. /// <param name="id">The id.</param>
  414. /// <param name="displayPreferences">The display preferences.</param>
  415. /// <returns>Task{DisplayPreferences}.</returns>
  416. /// <exception cref="System.ArgumentNullException">userId</exception>
  417. Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences);
  418. /// <summary>
  419. /// Posts a set of data to a url, and deserializes the return stream into T
  420. /// </summary>
  421. /// <typeparam name="T"></typeparam>
  422. /// <param name="url">The URL.</param>
  423. /// <param name="args">The args.</param>
  424. /// <returns>Task{``0}.</returns>
  425. Task<T> PostAsync<T>(string url, Dictionary<string, string> args)
  426. where T : class;
  427. /// <summary>
  428. /// This is a helper around getting a stream from the server that contains serialized data
  429. /// </summary>
  430. /// <param name="url">The URL.</param>
  431. /// <returns>Task{Stream}.</returns>
  432. Task<Stream> GetSerializedStreamAsync(string url);
  433. /// <summary>
  434. /// Gets the json serializer.
  435. /// </summary>
  436. /// <value>The json serializer.</value>
  437. IJsonSerializer JsonSerializer { get; set; }
  438. /// <summary>
  439. /// Gets or sets the server host name (myserver or 192.168.x.x)
  440. /// </summary>
  441. /// <value>The name of the server host.</value>
  442. string ServerHostName { get; set; }
  443. /// <summary>
  444. /// Gets or sets the port number used by the API
  445. /// </summary>
  446. /// <value>The server API port.</value>
  447. int ServerApiPort { get; set; }
  448. /// <summary>
  449. /// Gets or sets the type of the client.
  450. /// </summary>
  451. /// <value>The type of the client.</value>
  452. string ClientName { get; set; }
  453. /// <summary>
  454. /// Gets or sets the name of the device.
  455. /// </summary>
  456. /// <value>The name of the device.</value>
  457. string DeviceName { get; set; }
  458. /// <summary>
  459. /// Gets or sets the device id.
  460. /// </summary>
  461. /// <value>The device id.</value>
  462. string DeviceId { get; set; }
  463. /// <summary>
  464. /// Gets or sets the current user id.
  465. /// </summary>
  466. /// <value>The current user id.</value>
  467. string CurrentUserId { get; set; }
  468. /// <summary>
  469. /// Gets the image URL.
  470. /// </summary>
  471. /// <param name="item">The item.</param>
  472. /// <param name="options">The options.</param>
  473. /// <returns>System.String.</returns>
  474. /// <exception cref="ArgumentNullException">item</exception>
  475. string GetImageUrl(BaseItemDto item, ImageOptions options);
  476. /// <summary>
  477. /// Gets an image url that can be used to download an image from the api
  478. /// </summary>
  479. /// <param name="itemId">The Id of the item</param>
  480. /// <param name="options">The options.</param>
  481. /// <returns>System.String.</returns>
  482. /// <exception cref="ArgumentNullException">itemId</exception>
  483. string GetImageUrl(string itemId, ImageOptions options);
  484. /// <summary>
  485. /// Gets the user image URL.
  486. /// </summary>
  487. /// <param name="user">The user.</param>
  488. /// <param name="options">The options.</param>
  489. /// <returns>System.String.</returns>
  490. /// <exception cref="ArgumentNullException">user</exception>
  491. string GetUserImageUrl(UserDto user, ImageOptions options);
  492. /// <summary>
  493. /// Gets an image url that can be used to download an image from the api
  494. /// </summary>
  495. /// <param name="userId">The Id of the user</param>
  496. /// <param name="options">The options.</param>
  497. /// <returns>System.String.</returns>
  498. /// <exception cref="ArgumentNullException">userId</exception>
  499. string GetUserImageUrl(string userId, ImageOptions options);
  500. /// <summary>
  501. /// Gets the person image URL.
  502. /// </summary>
  503. /// <param name="item">The item.</param>
  504. /// <param name="options">The options.</param>
  505. /// <returns>System.String.</returns>
  506. /// <exception cref="ArgumentNullException">item</exception>
  507. string GetPersonImageUrl(BaseItemPerson item, ImageOptions options);
  508. /// <summary>
  509. /// Gets the person image URL.
  510. /// </summary>
  511. /// <param name="item">The item.</param>
  512. /// <param name="options">The options.</param>
  513. /// <returns>System.String.</returns>
  514. /// <exception cref="ArgumentNullException">item</exception>
  515. string GetPersonImageUrl(BaseItemDto item, ImageOptions options);
  516. /// <summary>
  517. /// Gets an image url that can be used to download an image from the api
  518. /// </summary>
  519. /// <param name="name">The name of the person</param>
  520. /// <param name="options">The options.</param>
  521. /// <returns>System.String.</returns>
  522. /// <exception cref="ArgumentNullException">name</exception>
  523. string GetPersonImageUrl(string name, ImageOptions options);
  524. /// <summary>
  525. /// Gets the year image URL.
  526. /// </summary>
  527. /// <param name="item">The item.</param>
  528. /// <param name="options">The options.</param>
  529. /// <returns>System.String.</returns>
  530. /// <exception cref="ArgumentNullException">item</exception>
  531. string GetYearImageUrl(BaseItemDto item, ImageOptions options);
  532. /// <summary>
  533. /// Gets an image url that can be used to download an image from the api
  534. /// </summary>
  535. /// <param name="year">The year.</param>
  536. /// <param name="options">The options.</param>
  537. /// <returns>System.String.</returns>
  538. string GetYearImageUrl(int year, ImageOptions options);
  539. /// <summary>
  540. /// Gets the genre image URL.
  541. /// </summary>
  542. /// <param name="item">The item.</param>
  543. /// <param name="options">The options.</param>
  544. /// <returns>System.String.</returns>
  545. /// <exception cref="ArgumentNullException">item</exception>
  546. string GetGenreImageUrl(BaseItemDto item, ImageOptions options);
  547. /// <summary>
  548. /// Gets an image url that can be used to download an image from the api
  549. /// </summary>
  550. /// <param name="name">The name.</param>
  551. /// <param name="options">The options.</param>
  552. /// <returns>System.String.</returns>
  553. /// <exception cref="ArgumentNullException">name</exception>
  554. string GetGenreImageUrl(string name, ImageOptions options);
  555. /// <summary>
  556. /// Gets the studio image URL.
  557. /// </summary>
  558. /// <param name="item">The item.</param>
  559. /// <param name="options">The options.</param>
  560. /// <returns>System.String.</returns>
  561. /// <exception cref="ArgumentNullException">item</exception>
  562. string GetStudioImageUrl(BaseItemDto item, ImageOptions options);
  563. /// <summary>
  564. /// Gets an image url that can be used to download an image from the api
  565. /// </summary>
  566. /// <param name="name">The name.</param>
  567. /// <param name="options">The options.</param>
  568. /// <returns>System.String.</returns>
  569. /// <exception cref="ArgumentNullException">name</exception>
  570. string GetStudioImageUrl(string name, ImageOptions options);
  571. /// <summary>
  572. /// Gets the artist image URL.
  573. /// </summary>
  574. /// <param name="item">The item.</param>
  575. /// <param name="options">The options.</param>
  576. /// <returns>System.String.</returns>
  577. /// <exception cref="ArgumentNullException">item
  578. /// or
  579. /// options</exception>
  580. string GetArtistImageUrl(BaseItemDto item, ImageOptions options);
  581. /// <summary>
  582. /// Gets the artist image URL.
  583. /// </summary>
  584. /// <param name="name">The name.</param>
  585. /// <param name="options">The options.</param>
  586. /// <returns>System.String.</returns>
  587. /// <exception cref="ArgumentNullException">name</exception>
  588. string GetArtistImageUrl(string name, ImageOptions options);
  589. /// <summary>
  590. /// This is a helper to get a list of backdrop url's from a given ApiBaseItemWrapper. If the actual item does not have any backdrops it will return backdrops from the first parent that does.
  591. /// </summary>
  592. /// <param name="item">A given item.</param>
  593. /// <param name="options">The options.</param>
  594. /// <returns>System.String[][].</returns>
  595. /// <exception cref="ArgumentNullException">item</exception>
  596. string[] GetBackdropImageUrls(BaseItemDto item, ImageOptions options);
  597. /// <summary>
  598. /// This is a helper to get the logo image url from a given ApiBaseItemWrapper. If the actual item does not have a logo, it will return the logo from the first parent that does, or null.
  599. /// </summary>
  600. /// <param name="item">A given item.</param>
  601. /// <param name="options">The options.</param>
  602. /// <returns>System.String.</returns>
  603. /// <exception cref="ArgumentNullException">item</exception>
  604. string GetLogoImageUrl(BaseItemDto item, ImageOptions options);
  605. /// <summary>
  606. /// Gets the art image URL.
  607. /// </summary>
  608. /// <param name="item">The item.</param>
  609. /// <param name="options">The options.</param>
  610. /// <returns>System.String.</returns>
  611. string GetArtImageUrl(BaseItemDto item, ImageOptions options);
  612. /// <summary>
  613. /// Gets the url needed to stream an audio file
  614. /// </summary>
  615. /// <param name="options">The options.</param>
  616. /// <returns>System.String.</returns>
  617. /// <exception cref="ArgumentNullException">options</exception>
  618. string GetAudioStreamUrl(StreamOptions options);
  619. /// <summary>
  620. /// Gets the url needed to stream a video file
  621. /// </summary>
  622. /// <param name="options">The options.</param>
  623. /// <returns>System.String.</returns>
  624. /// <exception cref="ArgumentNullException">options</exception>
  625. string GetVideoStreamUrl(VideoStreamOptions options);
  626. /// <summary>
  627. /// Formulates a url for streaming audio using the HLS protocol
  628. /// </summary>
  629. /// <param name="options">The options.</param>
  630. /// <returns>System.String.</returns>
  631. /// <exception cref="ArgumentNullException">options</exception>
  632. string GetHlsAudioStreamUrl(StreamOptions options);
  633. /// <summary>
  634. /// Formulates a url for streaming video using the HLS protocol
  635. /// </summary>
  636. /// <param name="options">The options.</param>
  637. /// <returns>System.String.</returns>
  638. /// <exception cref="ArgumentNullException">options</exception>
  639. string GetHlsVideoStreamUrl(VideoStreamOptions options);
  640. }
  641. }