blob: b37f8ccff9b28ce0baaa74cd59fe17479823de70 (
plain) (
blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#include "lyricsprovider.h"
LyricsProvider::LyricsProvider()
{
}
void LyricsProvider::setName(const QString &name)
{
m_name = name;
}
void LyricsProvider::setTitle(const QString &title)
{
m_title = title;
}
void LyricsProvider::setCharset(const QString &charset)
{
m_charser = charset;
}
void LyricsProvider::setUrl(const QString &url)
{
m_url = url;
}
void LyricsProvider::addUrlFormat(const QString &replace, const QString &with)
{
m_urlFormats << UrlFormat{ .replace = replace, .with = with };
}
void LyricsProvider::addRule(const QList<QPair<QString, QString> > &args, bool exclude)
{
Rule rule;
for(const QPair<QString, QString> &i : qAsConst(args))
{
Item item;
if(!i.first.isEmpty() && !i.second.isEmpty())
{
item.begin = i.first;
item.end = i.second;
}
else if(i.first.contains("://")) //url
{
item.url = i.first;
}
else
{
item.tag = i.first;
}
rule << item;
}
if(exclude)
m_excludeRules << rule;
else
m_extractRules << rule;
}
void LyricsProvider::addInvalidIndicator(const QString &indicator)
{
m_invalidIndicators << indicator;
}
|