Skip to content

Commit 60c6172

Browse files
committed
[-] remove unused files
1 parent 0ae2093 commit 60c6172

File tree

16 files changed

+40
-578
lines changed

16 files changed

+40
-578
lines changed

lib/lang/en.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,7 @@ const Map<String, String> en = {
5252
"请输入反馈信息": "Please input feedback message",
5353
"发送成功": "Send successful",
5454
"发送失败": "Send failed",
55-
"代理设置": "Proxy",
56-
"代 理": "P R O X Y",
57-
"Http 代理": "Http proxy",
58-
"端口": "Port",
59-
"Socks5 代理": "Socks5 proxy",
6055
"非法输入": "Invalid input",
61-
"Bilibili 已启用Http代理": "Bilibili has enabled Http proxy",
62-
"Bilibili 未启用Http代理": "Bilibili disable Http proxy",
63-
"Bilibili 已启用Socks5代理": "Bilibili has enabled Socks5 proxy",
64-
"Bilibili 未启用Socks5代理": "Bilibili disable Socks5 proxy",
65-
"Youtube 已启用Http代理": "Youtube has enabled Http proxy",
66-
"Youtube 未启用Http代理": "Youtube disable Http proxy",
67-
"Youtube 已启用Socks5代理": "Youtube has enabled Socks5 proxy",
68-
"Youtube 未启用Socks5代理": "Youtube disable Socks5 proxy",
6956
"发 现": "F I N D",
7057
"获取音频信息失败": "Fetch audio info failed",
7158
"搜索失败": "Search failed",

lib/lang/zh.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,7 @@ const Map<String, String> zh = {
5252
"Please input feedback message": "请输入反馈信息",
5353
"Send successful": "发送成功",
5454
"Send failed": "发送失败",
55-
"Proxy": "代理设置",
56-
"P R O X Y": "代 理",
57-
"Http proxy": "Http 代理",
58-
"Port": "端口",
59-
"Socks5 proxy": "Socks5 代理",
6055
"Invalid input": "非法输入",
61-
"Bilibili has enabled Http proxy": "Bilibili 已启用Http代理",
62-
"Bilibili disable Http proxy": "Bilibili 未启用Http代理",
63-
"Bilibili has enabled Socks5 proxy": "Bilibili 已启用Socks5代理",
64-
"Bilibili disable Socks5 proxy": "Bilibili 未启用Socks5代理",
65-
"Youtube has enabled Http proxy": "Youtube 已启用Http代理",
66-
"Youtube disable Http proxy": "Youtube 未启用Http代理",
67-
"Youtube has enabled Socks5 proxy": "Youtube 已启用Socks5代理",
68-
"Youtube disable Socks5 proxy": "Youtube 未启用Socks5代理",
6956
"F I N D": "发 现",
7057
"Fetch audio info failed": "获取音频信息失败",
7158
"Search failed": "搜索失败",

lib/models/find_controller.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ IconData downloadStateIcon(DownloadState state) {
3434

3535
class Info {
3636
final InfoData raw;
37-
ProxyType proxyType;
3837
String extention;
3938
String albumArtImagePath;
4039

@@ -140,18 +139,13 @@ class Info {
140139

141140
Info({
142141
required this.raw,
143-
this.proxyType = ProxyType.youtube,
144142
this.extention = "mp3",
145143
String? albumArtImagePath,
146144
bool isPlaying = false,
147145
DownloadState downloadState = DownloadState.undownload,
148146
}) : _isPlaying = isPlaying.obs,
149147
_downloadState = downloadState.obs,
150148
albumArtImagePath = albumArtImagePath ?? Albums.youtubeAsset;
151-
152-
String? proxyUrl() {
153-
return Get.find<SettingController>().proxy.url(proxyType);
154-
}
155149
}
156150

157151
class FindController extends GetxController {

lib/models/setting_controller.dart

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ import 'package:package_info_plus/package_info_plus.dart';
88

99
import '../lang/translation_service.dart';
1010

11-
enum ProxyType {
12-
youtube,
13-
bilibili,
14-
}
15-
1611
class Proxy implements TomlEncodableValue {
1712
Proxy({
1813
this.httpUrl = "127.0.0.1",
@@ -75,26 +70,6 @@ class Proxy implements TomlEncodableValue {
7570

7671
bool get enableBilibiliSocks5 => _enableBilibiliSocks5.value;
7772
set enableBilibiliSocks5(bool v) => _enableBilibiliSocks5.value = v;
78-
79-
String? url(ProxyType type) {
80-
switch (type) {
81-
case ProxyType.youtube:
82-
if (enableYoutubeHttp) {
83-
return "http://$httpUrl:$httpPort";
84-
} else if (enableYoutubeSocks5) {
85-
return "socks5://$socks5Url:$socks5Port";
86-
}
87-
break;
88-
case ProxyType.bilibili:
89-
if (enableBilibiliHttp) {
90-
return "http://$httpUrl:$httpPort";
91-
} else if (enableBilibiliSocks5) {
92-
return "socks5://$socks5Url:$socks5Port";
93-
}
94-
break;
95-
}
96-
return null;
97-
}
9873
}
9974

10075
class Find implements TomlEncodableValue {

lib/pages/find.dart

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ class _FindPageState extends State<FindPage> {
4242
}
4343

4444
Future<void> searchBilibili(String text) async {
45-
final proxyUrl = settingController.proxy.url(ProxyType.bilibili);
4645
final ids = await bilibili.bvFetchIds(
4746
keyword: text,
4847
maxIdCount: BigInt.from(max(1, settingController.find.searchCount)),
49-
proxyUrl: proxyUrl,
5048
);
5149

5250
for (String id in ids) {
@@ -55,11 +53,10 @@ class _FindPageState extends State<FindPage> {
5553
}
5654

5755
try {
58-
final vinfo = await bilibili.bvVideoInfo(bvid: id, proxyUrl: proxyUrl);
56+
final vinfo = await bilibili.bvVideoInfo(bvid: id);
5957
final info = Info(
6058
raw: vinfo,
6159
extention: "m4s",
62-
proxyType: ProxyType.bilibili,
6360
albumArtImagePath: Albums.bilibiliAsset,
6461
);
6562

@@ -126,7 +123,6 @@ class _FindPageState extends State<FindPage> {
126123
id: info.raw.videoId,
127124
cid: info.raw.bvCid,
128125
downloadPath: await findController.downloadPath(info),
129-
proxyUrl: info.proxyUrl(),
130126
);
131127

132128
info.setProgressStreamWithListen(progressStream, info);
@@ -137,9 +133,7 @@ class _FindPageState extends State<FindPage> {
137133
info.downloadState = DownloadState.downloading;
138134

139135
try {
140-
if (info.proxyType == ProxyType.bilibili) {
141-
await downlaodBilibili(info);
142-
}
136+
await downlaodBilibili(info);
143137
} catch (e) {
144138
log.d(e);
145139
}
@@ -304,12 +298,7 @@ class _FindPageState extends State<FindPage> {
304298
Expanded(
305299
child: GestureDetector(
306300
onTap: () async {
307-
late Uri url;
308-
if (info.proxyType == ProxyType.bilibili) {
309-
url = Uri.parse(
310-
bilibili.bvWatchUrl(id: info.raw.videoId));
311-
}
312-
301+
Uri url = Uri.parse(bilibili.bvWatchUrl(id: info.raw.videoId));
313302
try {
314303
await launchUrl(url);
315304
} catch (e) {

lib/pages/setting/find.dart

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -143,44 +143,6 @@ class _SettingFindPageState extends State<SettingFindPage> {
143143
FilteringTextInputFormatter.digitsOnly
144144
],
145145
),
146-
const SizedBox(height: CTheme.padding * 5),
147-
SettingSwitch(
148-
margin: EdgeInsets.zero,
149-
title: settingController.find.enableYoutubeSearch
150-
? '已启用Youtube搜索'.tr
151-
: '未启用Youtube搜索'.tr,
152-
isOn: settingController.find.enableYoutubeSearch,
153-
icon: Icons.smart_display,
154-
onChanged: (v) => settingController.find.enableYoutubeSearch = v,
155-
),
156-
const SizedBox(height: CTheme.padding * 5),
157-
SettingSwitch(
158-
margin: EdgeInsets.zero,
159-
title: settingController.find.enableBilibiliSearch
160-
? '已启用Bilibili搜索'.tr
161-
: '未启用Bilibili搜索'.tr,
162-
isOn: settingController.find.enableBilibiliSearch,
163-
icon: Icons.smart_display,
164-
onChanged: (v) => settingController.find.enableBilibiliSearch = v,
165-
),
166-
],
167-
);
168-
}
169-
170-
Widget buildOthers(BuildContext context) {
171-
return Column(
172-
children: [
173-
const SizedBox(height: CTheme.margin * 5, width: double.infinity),
174-
if (isFFmpegKitSupportPlatform())
175-
SettingSwitch(
176-
margin: EdgeInsets.zero,
177-
title: settingController.find.enableVideoToAudio
178-
? '已启用视频转音频'.tr
179-
: '未启用视频转音频'.tr,
180-
isOn: settingController.find.enableVideoToAudio,
181-
icon: Icons.transform,
182-
onChanged: (v) => settingController.find.enableVideoToAudio = v,
183-
),
184146
],
185147
);
186148
}
@@ -194,7 +156,6 @@ class _SettingFindPageState extends State<SettingFindPage> {
194156
child: ListView(
195157
children: [
196158
buildSearch(context, focusScopeNode),
197-
buildOthers(context),
198159
],
199160
),
200161
),

0 commit comments

Comments
 (0)