| 2334 | // Take the Coverfile for the first valid node in the dir, if it exists. |
| 2335 | if (icon_file.isEmpty()) |
| 2336 | { |
| 2337 | int list_count = node->childCount(); |
| 2338 | if (list_count > 0) |
| 2339 | { |
| 2340 | for (int i = 0; i < list_count; i++) |
| 2341 | { |
| 2342 | MythGenericTree *subnode = node->getChildAt(i); |
| 2343 | if (subnode) |
| 2344 | { |
| 2345 | Metadata *metadata = GetMetadataPtrFromNode(subnode); |
| 2346 | if (metadata) |
| 2347 | { |
| 2348 | if (!metadata->GetHost().isEmpty() && |
| 2349 | !metadata->GetCoverFile().startsWith("/")) |
| 2350 | { |
| 2351 | icon_file = GenRemoteFileURL("Coverart", |
| 2352 | metadata->GetHost(), metadata->GetCoverFile()); |
| 2353 | if (!icon_file.endsWith("/") && !icon_file.isEmpty()) |
| 2354 | break; |
| 2355 | } |
| 2356 | else |
| 2357 | { |
| 2358 | icon_file = metadata->GetCoverFile(); |
| 2359 | if (!icon_file.isEmpty()) |
| 2360 | break; |
| 2361 | } |
| 2362 | } |
| 2363 | } |
| 2364 | } |
| 2365 | } |
| 2366 | } |
| 2367 | |