Skip to content
Snippets Groups Projects
Commit 48dc721f authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Use URI for source name if missing

parent d49c2c6b
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28292 failed
......@@ -521,7 +521,7 @@ std::string Feed::getName(const std::string &puri) {
auto n = net_->findOne<std::string>("get_cfg", puri);
if (n) {
auto j = nlohmann::json::parse(*n);
return (j.is_structured()) ? j.value("name", j.value("uri", "No Name")) : "No Name";
return (j.is_structured()) ? j.value("name", j.value("uri", uri.getPathSegment(-1))) : uri.getPathSegment(-1);
}
} catch (const ftl::exception &e) {
e.ignore();
......@@ -540,7 +540,7 @@ std::string Feed::getName(const std::string &puri) {
return getConfig()["recent_files"][uri.getBaseURI()].value("name", "FTLFile");
}
return "No Name";
return uri.getPathSegment(-1);
}
void Feed::add(uint32_t fsid, const std::string &uri, ftl::stream::Stream* stream) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment