IApiClient.cs 26 KB

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