IApiClient.cs 25 KB

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