MCPcopy Create free account
hub / github.com/comaps/comaps / ToWikimediaCommonsURL

Method ToWikimediaCommonsURL

libs/indexer/feature_meta.cpp:64–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64std::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
79void Metadata::EncodeWikiURL(int startIndex, std::string & url)
80{

Callers 1

UNIT_TESTFunction · 0.80

Calls 1

emptyMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64