Compare commits
3 commits
eb13ce2e41
...
359cd64dc6
Author | SHA1 | Date | |
---|---|---|---|
|
359cd64dc6 | ||
|
637744236c | ||
|
5d45fdf4bd |
3 changed files with 13 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
## 1.1.2
|
||||||
|
- Opravit negativní čísla v kreditu, účet pro platby by @tpkowastaken in https://github.com/hernikplays/canteenlib/pull/4
|
||||||
## 1.1.1
|
## 1.1.1
|
||||||
- Opravit problém s burzou
|
- Opravit problém s burzou
|
||||||
## 1.1.0-alpha.1
|
## 1.1.0-alpha.1
|
||||||
|
|
|
@ -48,17 +48,19 @@ class Canteen {
|
||||||
prihlasen = false;
|
prihlasen = false;
|
||||||
return Future.error("Uživatel není přihlášen");
|
return Future.error("Uživatel není přihlášen");
|
||||||
}
|
}
|
||||||
var m = double.tryParse(RegExp(r' +<span id="Kredit" .+?>(.+?)(?=&)')
|
var kreditMatch = double.tryParse(RegExp(r' +<span id="Kredit" .+?>(.+?)(?=&)')
|
||||||
.firstMatch(r)!
|
.firstMatch(r)!
|
||||||
.group(1)!
|
.group(1)!
|
||||||
.replaceAll(",", ".")
|
.replaceAll(",", ".")
|
||||||
.replaceAll(RegExp(r"[^\w.]"), ""));
|
.replaceAll(RegExp(r"[^\w.-]"), ""));
|
||||||
var jmenoMatch = RegExp(r'(?<=jméno: <b>).+?(?=<\/b)').firstMatch(r);
|
var jmenoMatch = RegExp(r'(?<=jméno: <b>).+?(?=<\/b)').firstMatch(r);
|
||||||
var prijmeniMatch = RegExp(r'(?<=příjmení: <b>).+?(?=<\/b)').firstMatch(r);
|
var prijmeniMatch = RegExp(r'(?<=příjmení: <b>).+?(?=<\/b)').firstMatch(r);
|
||||||
var kategorieMatch =
|
var kategorieMatch =
|
||||||
RegExp(r'(?<=kategorie: <b>).+?(?=<\/b)').firstMatch(r);
|
RegExp(r'(?<=kategorie: <b>).+?(?=<\/b)').firstMatch(r);
|
||||||
var ucetMatch = RegExp(r'(?<=účet pro platby do jídelny: <b>).+?(?=<\/b)')
|
var ucetMatch = RegExp(r'účet pro platby do jídelny:\s*<b>(\d+/\d+)</b>')
|
||||||
.firstMatch(r);
|
.firstMatch(r)
|
||||||
|
?.group(1)
|
||||||
|
?.replaceAll(RegExp(r'<\/?b>'), '');//odstranit html tag <b>
|
||||||
var varMatch =
|
var varMatch =
|
||||||
RegExp(r'(?<=variabilní symbol: <b>).+?(?=<\/b)').firstMatch(r);
|
RegExp(r'(?<=variabilní symbol: <b>).+?(?=<\/b)').firstMatch(r);
|
||||||
var specMatch =
|
var specMatch =
|
||||||
|
@ -67,9 +69,10 @@ class Canteen {
|
||||||
var jmeno = jmenoMatch?.group(0) ?? "";
|
var jmeno = jmenoMatch?.group(0) ?? "";
|
||||||
var prijmeni = prijmeniMatch?.group(0) ?? "";
|
var prijmeni = prijmeniMatch?.group(0) ?? "";
|
||||||
var kategorie = kategorieMatch?.group(0) ?? "";
|
var kategorie = kategorieMatch?.group(0) ?? "";
|
||||||
var ucet = ucetMatch?.group(0) ?? "";
|
var ucet = ucetMatch ?? "";
|
||||||
var varSymbol = varMatch?.group(0) ?? "";
|
var varSymbol = varMatch?.group(0) ?? "";
|
||||||
var specSymbol = specMatch?.group(0) ?? "";
|
var specSymbol = specMatch?.group(0) ?? "";
|
||||||
|
var kredit = kreditMatch ?? 0.0;
|
||||||
|
|
||||||
return Uzivatel(
|
return Uzivatel(
|
||||||
jmeno: jmeno,
|
jmeno: jmeno,
|
||||||
|
@ -78,7 +81,7 @@ class Canteen {
|
||||||
ucetProPlatby: ucet,
|
ucetProPlatby: ucet,
|
||||||
varSymbol: varSymbol,
|
varSymbol: varSymbol,
|
||||||
specSymbol: specSymbol,
|
specSymbol: specSymbol,
|
||||||
kredit: m ?? 0.0);
|
kredit: kredit);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _getFirstSession() async {
|
Future<void> _getFirstSession() async {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
name: canteenlib
|
name: canteenlib
|
||||||
description: Library for communication with the czech canteen food ordering system iCanteen
|
description: Library for communication with the czech canteen food ordering system iCanteen
|
||||||
version: 1.1.1
|
version: 1.1.2
|
||||||
repository: 'https://git.mnau.xyz/hernik/canteenlib'
|
repository: 'https://git.mnau.xyz/hernik/canteenlib'
|
||||||
issue_tracker: 'https://git.mnau.xyz/hernik/canteenlib/issues'
|
issue_tracker: 'https://git.mnau.xyz/hernik/canteenlib/issues'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.16.1 <3.0.0'
|
sdk: '>=2.16.1 <4.0.0'
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
dotenv: ^4.0.1
|
dotenv: ^4.0.1
|
||||||
|
|
Reference in a new issue