IApiClient.cs 26 KB

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