File: utils.cpp

package info (click to toggle)
android-file-transfer 4.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,496 kB
  • sloc: cpp: 12,909; python: 140; lex: 47; xml: 26; sh: 13; makefile: 6
file content (35 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "utils.h"

int GetCoverScore(const QString & str_)
{
	QString str = str_.toLower();
	int score = 0;
	if (str.contains("0001"))
		score += 1001;
	else if (str.contains("0000"))
		score += 1000;
	else if (str.contains("001"))
		score += 101;
	else if (str.contains("000"))
		score += 100;
	else if (str.contains("01"))
		score += 11;
	else if (str.contains("00"))
		score += 10;
	else if (str.contains("1"))
		score += 1;

	if (str.contains("art"))
		score += 10000;
	if (str.contains("album"))
		score += 10000;
	if (str.contains("cover"))
		score += 20000;
	if (str.contains("large"))
		score += 20000;
	if (str.contains("small"))
		score += 10000;
	if (str.contains("folder"))
		score += 10000;
	return score;
}