Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #18

Merged
merged 7 commits into from
May 23, 2022
2 changes: 2 additions & 0 deletions resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@
"user": {
"notSupported": "Not Supported",
"notLogged": "Not logged",
"needLogin": "Not logged",
"unknown": "Unknown",
"getUserInfoFailed": "Failed to get username and id",
"abortGetUserInfoFailed": "Cancel request to get user information failed"
}
Expand Down
2 changes: 2 additions & 0 deletions resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@
"user": {
"notSupported": "暂不支持",
"notLogged": "未登录",
"needLogin": "未登录",
"unknown": "未知错误",
"getUserInfoFailed": "获取用户名和编号失败",
"abortGetUserInfoFailed": "取消获取用户信息请求失败"
}
Expand Down
9 changes: 6 additions & 3 deletions resource/schemas/IPTorrents/getSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
comments:
fieldIndex.comments == -1
? ""
: cells.eq(fieldIndex.comments).text() || 0,
: cells.eq(fieldIndex.comments).text().replace("Go to comments","") || 0,
site: site,
tags: Searcher.getRowTags(site, row),
entryName: options.entry.name,
Expand All @@ -202,10 +202,13 @@
}

getTime(row) {
let text = row.find(".t_ctime").text();
let text = row.find("td.al div.sub").text();
if (text) {
if (text.indexOf("|") > 0) {
return text.split("|")[1].trim();
text=text.split("|")[1];
if (text.indexOf("by") > 0) {
return text.split("|")[0].trim();
}
}
}
return text;
Expand Down
4 changes: 2 additions & 2 deletions resource/schemas/NexusPHP/getSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@
? null
: this.getFieldValue(row, cells, fieldIndex, "category") ||
this.getCategory(cells.eq(fieldIndex.category)),
progress: this.getFieldValue(row, cells, fieldIndex, "progress"),
status: this.getFieldValue(row, cells, fieldIndex, "status")
progress: Searcher.getFieldValue(site, row, "progress"),
status: Searcher.getFieldValue(site, row, "status")
};

results.push(data);
Expand Down
10 changes: 8 additions & 2 deletions resource/sites/passthepopcorn.me/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
"page": "/torrents.php",
"resultType": "json",
"parseScriptFile": "getSearchResult.js",
"queryString": "searchstr=$key$&grouping=0&json=noredirect"
"queryString": "searchstr=$key$&grouping=0&inallakas=1&json=noredirect"
},
"searchEntry": [{
"name": "全部",
"name": "Normal",
"enabled": true
},
{
"name": "filelist",
"skipIMDbId": true,
"queryString":"filelist=$key$&grouping=0&json=noredirect",
"enabled": false
}],
"selectors": {
"userBaseInfo": {
Expand Down
16 changes: 16 additions & 0 deletions resource/sites/ptsbao.club/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
"tags": ["影视", "综合"],
"host": "ptsbao.club",
"collaborator": ["laizony", "ted423"],
"searchEntryConfig": {
"merge": true,
"fieldSelector": {
"progress": {
"selector": ["tr.finished,tr.seeders"],
"filters": ["query.length?100:null"]
},
"status": {
"selector": ["tr.finished", "tr.seeders"],
"switchFilters": [
["255"],
["2"]
]
}
}
},
"selectors": {
"userBaseInfo": {
"merge": true,
Expand Down
1 change: 1 addition & 0 deletions src/background/infoParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class InfoParser {
query = content;
} else {
query = content.find(selector);
if (query.length == 0)query = content.filter(selector)
}

if (query.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/options/components/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default Vue.extend({
{
title: "navigation.settings.permissions",
icon: "verified_user",
key: "set-permissions"
key: "/set-permissions"
}
]
},
Expand Down
18 changes: 14 additions & 4 deletions src/options/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
target="_blank"
rel="noopener noreferrer nofollow"
class="nodecoration"
>{{ props.item.user.lastErrorMsg }}</a>
<span v-else>{{ props.item.user.lastErrorMsg }}</span>
>{{ formatError(props.item.user) }}</a>
<span v-else>{{ formatError(props.item.user) }}</span>
</span>
</td>
</template>
Expand Down Expand Up @@ -446,7 +446,17 @@ export default Vue.extend({
showWeek: this.showWeek
}
});
}
},

formatError(user: any) {
if (user.lastErrorMsg) {
return user.lastErrorMsg;
}
if (user.lastUpdateStatus && user.lastUpdateStatus !== EUserDataRequestStatus.success) {
return this.$t(`service.user.${user.lastUpdateStatus}`);
}
return '';
},
},

filters: {
Expand Down Expand Up @@ -517,7 +527,7 @@ export default Vue.extend({
align: "right",
value: "user.lastUpdateTime"
},
{ text: this.$t("home.headers.status"), align: "center", value: "" }
{ text: this.$t("home.headers.status"), align: "center", value: "user.lastUpdateStatus" }
];
}
}
Expand Down