| 62 | } |
| 63 | |
| 64 | std::string Metadata::ToWikimediaCommonsURL(std::string v) |
| 65 | { |
| 66 | if (v.empty()) |
| 67 | return v; |
| 68 | |
| 69 | EncodeWikiURL(0, v); |
| 70 | |
| 71 | // Use the media viewer for single files |
| 72 | if (v.starts_with("File:")) |
| 73 | return kBaseCommonsUrl + v + "#/media/" + v; |
| 74 | |
| 75 | // or standard if it's a category |
| 76 | return kBaseCommonsUrl + v; |
| 77 | } |
| 78 | |
| 79 | void Metadata::EncodeWikiURL(int startIndex, std::string & url) |
| 80 | { |