Mercurial > hg > orthanc-webviewer
comparison Plugin/ViewerPrefetchPolicy.cpp @ 101:2932473a9b19 refactoring
fix prefetching
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Nov 2015 22:05:51 +0100 |
parents | 46ec13a1177c |
children | 3809121c3290 |
comparison
equal
deleted
inserted
replaced
100:f5b1a9267da0 | 101:2932473a9b19 |
---|---|
72 { | 72 { |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 std::string compression = path.substr(0, separator + 1); | 76 std::string compression = path.substr(0, separator + 1); |
77 std::string instanceId = path.substr(separator + 1); | 77 std::string instanceAndFrame = path.substr(separator + 1); |
78 | 78 |
79 instanceId = instanceId.substr(0, instanceId.find('_')); | 79 std::string instanceId = instanceAndFrame.substr(0, instanceAndFrame.find('_')); |
80 | 80 |
81 Json::Value instance; | 81 Json::Value instance; |
82 if (!GetJsonFromOrthanc(instance, context_, "/instances/" + instanceId) || | 82 if (!GetJsonFromOrthanc(instance, context_, "/instances/" + instanceId) || |
83 !instance.isMember("ParentSeries")) | 83 !instance.isMember("ParentSeries")) |
84 { | 84 { |
98 { | 98 { |
99 return; | 99 return; |
100 } | 100 } |
101 | 101 |
102 const Json::Value& instances = series["Slices"]; | 102 const Json::Value& instances = series["Slices"]; |
103 | |
103 if (instances.type() != Json::arrayValue) | 104 if (instances.type() != Json::arrayValue) |
104 { | 105 { |
105 return; | 106 return; |
106 } | 107 } |
107 | 108 |
108 Json::Value::ArrayIndex position = 0; | 109 Json::Value::ArrayIndex position = 0; |
109 while (position < instances.size()) | 110 while (position < instances.size()) |
110 { | 111 { |
111 if (instances[position] == instanceId) | 112 if (instances[position] == instanceAndFrame) |
112 { | 113 { |
113 break; | 114 break; |
114 } | 115 } |
115 | 116 |
116 position++; | 117 position++; |