MCPcopy Create free account
hub / github.com/QNapi/qnapi / needToShowList

Method needToShowList

gui/src/qnapi.cpp:120–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool QNapi::needToShowList() {
121 theBestIdx = 0;
122
123 int i = 0;
124 bool foundBestIdx = false;
125 foreach (SubtitleInfo s, listSubtitles()) {
126 if (s.resolution == SUBTITLE_GOOD) {
127 theBestIdx = i;
128 foundBestIdx = true;
129 break;
130 }
131 ++i;
132 }
133
134 if (config.generalConfig().downloadPolicy() == DP_ALWAYS_SHOW_LIST)
135 return true;
136 if (config.generalConfig().downloadPolicy() == DP_NEVER_SHOW_LIST)
137 return false;
138
139 if (listSubtitles().size() <= 1) return false;
140
141 return !foundBestIdx;
142}
143
144int QNapi::bestIdx() { return theBestIdx; }
145

Callers 2

foreachFunction · 0.80
runMethod · 0.80

Calls 2

downloadPolicyMethod · 0.80
generalConfigMethod · 0.80

Tested by

no test coverage detected