@@ -65,7 +65,12 @@ public override MetadataFile GetCoverImage()
65
65
logger . Info ( "GetCoverImage" ) ;
66
66
if ( options . IsBackgroundDownload )
67
67
{
68
- var gameUrl = services . getCoverImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
68
+ string gameUrl ;
69
+ if ( options . GameData . Source != null && options . GameData . GameId != null ) {
70
+ gameUrl = services . getCoverImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
71
+ } else {
72
+ gameUrl = services . getCoverImageUrl ( options . GameData . Name ) ;
73
+ }
69
74
if ( gameUrl == "bad path" ) {
70
75
return base . GetCoverImage ( ) ;
71
76
} else {
@@ -108,8 +113,12 @@ public override MetadataFile GetBackgroundImage()
108
113
{
109
114
if ( options . IsBackgroundDownload )
110
115
{
111
-
112
- var gameUrl = services . getHeroImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
116
+ string gameUrl ;
117
+ if ( options . GameData . Source != null && options . GameData . GameId != null ) {
118
+ gameUrl = services . getHeroImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
119
+ } else {
120
+ gameUrl = services . getHeroImageUrl ( options . GameData . Name ) ;
121
+ }
113
122
if ( gameUrl == "bad path" ) {
114
123
return base . GetBackgroundImage ( ) ;
115
124
} else {
@@ -152,7 +161,14 @@ public override MetadataFile GetIcon()
152
161
{
153
162
if ( options . IsBackgroundDownload )
154
163
{
155
- var gameUrl = services . getLogoImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
164
+ var logger = LogManager . GetLogger ( ) ;
165
+ logger . Info ( "SGDBMetadataProvider GetIcon options " + options . GameData . ToString ( ) ) ;
166
+ string gameUrl ;
167
+ if ( options . GameData . Source != null && options . GameData . GameId != null ) {
168
+ gameUrl = services . getLogoImageUrl ( options . GameData . Name , convertPlayniteGameSourceToSGDBPlatformEnum ( options . GameData . Source . ToString ( ) . ToLower ( ) ) , options . GameData . GameId ) ;
169
+ } else {
170
+ gameUrl = services . getLogoImageUrl ( options . GameData . Name ) ;
171
+ }
156
172
if ( gameUrl == "bad path" ) {
157
173
return base . GetIcon ( ) ;
158
174
} else {
0 commit comments