22using Sidekick . Apis . Poe . Account . Clients ;
33using Sidekick . Apis . Poe . Account . Stash . Models ;
44using Sidekick . Apis . Poe . Trade . Models . Items ;
5- using Sidekick . Common . Extensions ;
65using Sidekick . Common . Game . Items ;
76using Sidekick . Common . Settings ;
87
@@ -16,9 +15,9 @@ ISettingsService settingsService
1615{
1716 public async Task < List < StashTab > > GetStashTabList ( )
1817 {
19- var leagueId = await settingsService . GetString ( SettingKeys . LeagueId ) ;
20- var response = await client . Fetch < StashTabListResult > ( $ "stash/{ leagueId . GetUrlSlugForLeague ( ) } ") ;
21- if ( response == null || leagueId == null ) return [ ] ;
18+ var league = await settingsService . GetLeague ( ) ;
19+ var response = await client . Fetch < StashTabListResult > ( $ "stash/{ league } ") ;
20+ if ( response == null || league == null ) return [ ] ;
2221
2322 return FlattenStashTabs ( response . Tabs ) ;
2423 }
@@ -41,9 +40,9 @@ private static List<StashTab> FlattenStashTabs(List<StashTab> stashTabs)
4140
4241 public async Task < StashTab ? > GetStashDetails ( string id )
4342 {
44- var leagueId = await settingsService . GetString ( SettingKeys . LeagueId ) ;
45- var result = await client . Fetch < StashTabResult > ( $ "stash/{ leagueId . GetUrlSlugForLeague ( ) } /{ id } ") ;
46- if ( result == null || leagueId == null ) return null ;
43+ var league = await settingsService . GetLeague ( ) ;
44+ var result = await client . Fetch < StashTabResult > ( $ "stash/{ league } /{ id } ") ;
45+ if ( result == null || league == null ) return null ;
4746
4847 if ( result . Stash . Type == StashType . Map )
4948 {
@@ -63,8 +62,8 @@ private async Task<List<ApiItem>> FetchStashItems(StashTab tab)
6362
6463 if ( tab . Items == null && tab . Children == null )
6564 {
66- var leagueId = await settingsService . GetString ( SettingKeys . LeagueId ) ;
67- var uri = string . IsNullOrEmpty ( tab . Parent ) ? $ "stash/{ leagueId . GetUrlSlugForLeague ( ) } /{ tab . Id } " : $ "stash/{ leagueId } /{ tab . Parent } /{ tab . Id } ";
65+ var league = await settingsService . GetLeague ( ) ;
66+ var uri = string . IsNullOrEmpty ( tab . Parent ) ? $ "stash/{ league } /{ tab . Id } " : $ "stash/{ league } /{ tab . Parent } /{ tab . Id } ";
6867
6968 var wrapper = await client . Fetch < StashTabResult > ( uri ) ;
7069 if ( wrapper ? . Stash . Items != null )
@@ -98,13 +97,8 @@ private async Task<List<ApiItem>> FetchMapStashItems(StashTab tab)
9897 return new ( ) ;
9998 }
10099
101- var leagueId = await settingsService . GetString ( SettingKeys . LeagueId ) ;
102- if ( leagueId == null )
103- {
104- return
105- [
106- ] ;
107- }
100+ var league = await settingsService . GetLeague ( ) ;
101+ if ( league == null ) return [ ] ;
108102
109103 var items = new List < ApiItem > ( ) ;
110104 foreach ( var childTab in tab . Children )
0 commit comments