IApiClient.cs 27 KB

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