update movie, tvshow
This commit is contained in:
@@ -317,7 +317,7 @@ class MovieDetailsScreen extends StatelessWidget {
|
|||||||
'originalTitle': movieDetails.originalTitle,
|
'originalTitle': movieDetails.originalTitle,
|
||||||
'overview': movieDetails.overview,
|
'overview': movieDetails.overview,
|
||||||
'releaseDate':
|
'releaseDate':
|
||||||
DateFormat('yyyy-MM-dd').format(movieDetails.releaseDate),
|
DateFormat('yyyy-MM-dd').format(movieDetails.releaseDate),
|
||||||
'resolution': movieDetails.resolution,
|
'resolution': movieDetails.resolution,
|
||||||
'state': movieDetails.state.toString(),
|
'state': movieDetails.state.toString(),
|
||||||
'backdropPath': movieDetails.backdropPath,
|
'backdropPath': movieDetails.backdropPath,
|
||||||
@@ -334,7 +334,7 @@ class MovieDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print (e.toString());
|
print(e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -369,6 +369,28 @@ class MovieDetailsScreen extends StatelessWidget {
|
|||||||
Navigator.pop(context, null);
|
Navigator.pop(context, null);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
const VerticalDivider(
|
||||||
|
width: 10,
|
||||||
|
thickness: 3,
|
||||||
|
indent: 0,
|
||||||
|
endIndent: 0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.update_outlined),
|
||||||
|
tooltip: 'Update movie',
|
||||||
|
onPressed: () {
|
||||||
|
//todo
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.delete_outline),
|
||||||
|
color: Colors.red,
|
||||||
|
tooltip: 'Delete movie',
|
||||||
|
onPressed: () {
|
||||||
|
//todo
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: FutureBuilder<Object>(
|
body: FutureBuilder<Object>(
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
path: dbPath,
|
path: dbPath,
|
||||||
);
|
);
|
||||||
|
|
||||||
print(url.toString());
|
|
||||||
|
|
||||||
final r = http.post(
|
final r = http.post(
|
||||||
url,
|
url,
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
@@ -77,7 +75,6 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
print (url);
|
|
||||||
final response = await http.get(url);
|
final response = await http.get(url);
|
||||||
bool? error;
|
bool? error;
|
||||||
String? errorMessage;
|
String? errorMessage;
|
||||||
@@ -335,9 +332,30 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool save() {
|
bool save() {
|
||||||
|
updateTVShow();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> updateTVShow() async {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void settingsChanged(
|
||||||
|
String download, String localPath, String resolution, int cliffhanger) {
|
||||||
|
tvShowDetails.download = download;
|
||||||
|
tvShowDetails.localPath = localPath;
|
||||||
|
tvShowDetails.resolution = resolution;
|
||||||
|
tvShowDetails.cliffhanger = cliffhanger;
|
||||||
|
}
|
||||||
|
|
||||||
|
void stateChanged(List<Season> seasonStatus) {
|
||||||
|
tvShowDetails.seasonStatus = seasonStatus;
|
||||||
|
|
||||||
|
for (var s in tvShowDetails.seasonStatus) {
|
||||||
|
print('Season: ${s.seasonNumber}, State: ${s.state}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String firstAiredYear = tvShow.firstAired.toString().substring(0, 4);
|
String firstAiredYear = tvShow.firstAired.toString().substring(0, 4);
|
||||||
@@ -351,8 +369,7 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
tooltip: 'Save changes',
|
tooltip: 'Save changes',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (save()) {
|
if (save()) {
|
||||||
testPost('bla');
|
Navigator.pop(context, tvShowDetails);
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -360,7 +377,29 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
icon: const Icon(Icons.highlight_off),
|
icon: const Icon(Icons.highlight_off),
|
||||||
tooltip: 'Revert changes',
|
tooltip: 'Revert changes',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context, null);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const VerticalDivider(
|
||||||
|
width: 10,
|
||||||
|
thickness: 3,
|
||||||
|
indent: 0,
|
||||||
|
endIndent: 0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.update_outlined),
|
||||||
|
tooltip: 'Update movie',
|
||||||
|
onPressed: () {
|
||||||
|
//todo
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.delete_outline),
|
||||||
|
color: Colors.red,
|
||||||
|
tooltip: 'Delete movie',
|
||||||
|
onPressed: () {
|
||||||
|
//todo
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -409,6 +448,7 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
localPath: tvShowDetails.localPath,
|
localPath: tvShowDetails.localPath,
|
||||||
resolution: tvShowDetails.resolution,
|
resolution: tvShowDetails.resolution,
|
||||||
cliffhanger: tvShowDetails.cliffhanger,
|
cliffhanger: tvShowDetails.cliffhanger,
|
||||||
|
settingsChanged: settingsChanged,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@@ -420,6 +460,7 @@ class TVShowDetailsScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: TVShowDetailsSeasons(
|
child: TVShowDetailsSeasons(
|
||||||
seasonStatus: tvShowDetails.seasonStatus,
|
seasonStatus: tvShowDetails.seasonStatus,
|
||||||
|
stateChanged: stateChanged,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -7,10 +7,16 @@ import 'package:multimedia/data/tvshows.dart';
|
|||||||
enum SingingCharacter { init, prog, done }
|
enum SingingCharacter { init, prog, done }
|
||||||
|
|
||||||
class TVShowDetailsSeasonBox extends StatefulWidget {
|
class TVShowDetailsSeasonBox extends StatefulWidget {
|
||||||
TVShowDetailsSeasonBox({super.key, required this.season});
|
TVShowDetailsSeasonBox({
|
||||||
|
super.key,
|
||||||
|
required this.season,
|
||||||
|
required this.stateChanged,
|
||||||
|
});
|
||||||
|
|
||||||
Season season;
|
Season season;
|
||||||
|
|
||||||
|
final Function(int seasonNumber, String state) stateChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TVShowDetailsSeasonBox> createState() => _TVShowDetailsSeasonBoxState();
|
State<TVShowDetailsSeasonBox> createState() => _TVShowDetailsSeasonBoxState();
|
||||||
}
|
}
|
||||||
@@ -22,6 +28,8 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
widget.season.state =
|
widget.season.state =
|
||||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|1");
|
widget.season.state.replaceAllMapped(exp, (Match m) => "|1");
|
||||||
|
|
||||||
|
widget.stateChanged(widget.season.seasonNumber, widget.season.state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +39,8 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
widget.season.state =
|
widget.season.state =
|
||||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|2");
|
widget.season.state.replaceAllMapped(exp, (Match m) => "|2");
|
||||||
|
|
||||||
|
widget.stateChanged(widget.season.seasonNumber, widget.season.state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +50,8 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
widget.season.state =
|
widget.season.state =
|
||||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|3");
|
widget.season.state.replaceAllMapped(exp, (Match m) => "|3");
|
||||||
|
|
||||||
|
widget.stateChanged(widget.season.seasonNumber, widget.season.state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,6 +65,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
widget.season.state = stateList.join(',');
|
widget.season.state = stateList.join(',');
|
||||||
|
widget.stateChanged(widget.season.seasonNumber, widget.season.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -168,7 +181,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
BoxColor.titleBackgroundColor),
|
BoxColor.titleBackgroundColor),
|
||||||
onPressed: initClicked,
|
onPressed: initClicked,
|
||||||
child: Text(
|
child: Text(
|
||||||
'init',
|
'init',
|
||||||
@@ -182,7 +195,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
TableCell(
|
TableCell(
|
||||||
child: Checkbox(
|
child: Checkbox(
|
||||||
side: MaterialStateBorderSide.resolveWith(
|
side: MaterialStateBorderSide.resolveWith(
|
||||||
(states) => const BorderSide(
|
(states) => const BorderSide(
|
||||||
width: 1.0, color: Colors.grey),
|
width: 1.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
value: s.split('|')[1] == '1',
|
value: s.split('|')[1] == '1',
|
||||||
@@ -213,7 +226,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
BoxColor.titleBackgroundColor),
|
BoxColor.titleBackgroundColor),
|
||||||
onPressed: progClicked,
|
onPressed: progClicked,
|
||||||
child: Text(
|
child: Text(
|
||||||
'prog',
|
'prog',
|
||||||
@@ -227,7 +240,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
TableCell(
|
TableCell(
|
||||||
child: Checkbox(
|
child: Checkbox(
|
||||||
side: MaterialStateBorderSide.resolveWith(
|
side: MaterialStateBorderSide.resolveWith(
|
||||||
(states) => const BorderSide(
|
(states) => const BorderSide(
|
||||||
width: 1.0, color: Colors.grey),
|
width: 1.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
value: s.split('|')[1] == '2',
|
value: s.split('|')[1] == '2',
|
||||||
@@ -258,7 +271,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
BoxColor.titleBackgroundColor),
|
BoxColor.titleBackgroundColor),
|
||||||
onPressed: doneClicked,
|
onPressed: doneClicked,
|
||||||
child: Text(
|
child: Text(
|
||||||
'done',
|
'done',
|
||||||
@@ -272,7 +285,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
|||||||
TableCell(
|
TableCell(
|
||||||
child: Checkbox(
|
child: Checkbox(
|
||||||
side: MaterialStateBorderSide.resolveWith(
|
side: MaterialStateBorderSide.resolveWith(
|
||||||
(states) => const BorderSide(
|
(states) => const BorderSide(
|
||||||
width: 1.0, color: Colors.grey),
|
width: 1.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
value: s.split('|')[1] == '3',
|
value: s.split('|')[1] == '3',
|
||||||
|
|||||||
@@ -8,10 +8,24 @@ class TVShowDetailsSeasons extends StatefulWidget {
|
|||||||
TVShowDetailsSeasons({
|
TVShowDetailsSeasons({
|
||||||
super.key,
|
super.key,
|
||||||
required this.seasonStatus,
|
required this.seasonStatus,
|
||||||
|
required this.stateChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
List<Season> seasonStatus;
|
List<Season> seasonStatus;
|
||||||
|
|
||||||
|
final Function(List<Season>) stateChanged;
|
||||||
|
|
||||||
|
void stateChanged1(int seasonNumber, String state) {
|
||||||
|
print('start stateChanged1 in seasons ...');
|
||||||
|
for (int seasonID = 0; seasonID < seasonStatus.length; seasonID++) {
|
||||||
|
if (seasonStatus[seasonID].seasonNumber == seasonNumber) {
|
||||||
|
seasonStatus[seasonID].state = state;
|
||||||
|
stateChanged(seasonStatus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TVShowDetailsSeasons> createState() => _TVShowDetailsSeasonsState();
|
State<TVShowDetailsSeasons> createState() => _TVShowDetailsSeasonsState();
|
||||||
}
|
}
|
||||||
@@ -26,6 +40,7 @@ class _TVShowDetailsSeasonsState extends State<TVShowDetailsSeasons> {
|
|||||||
children: [
|
children: [
|
||||||
TVShowDetailsSeasonBox(
|
TVShowDetailsSeasonBox(
|
||||||
season: s,
|
season: s,
|
||||||
|
stateChanged: widget.stateChanged1,
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
|
|||||||
@@ -7,18 +7,42 @@ import 'package:multimedia/widgets/tvshows/details/settingsBoxResolution.dart';
|
|||||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxCliffhanger.dart';
|
import 'package:multimedia/widgets/tvshows/details/settingsBoxCliffhanger.dart';
|
||||||
|
|
||||||
class TVShowDetailsSettingsBox extends StatelessWidget {
|
class TVShowDetailsSettingsBox extends StatelessWidget {
|
||||||
const TVShowDetailsSettingsBox({
|
TVShowDetailsSettingsBox({
|
||||||
super.key,
|
super.key,
|
||||||
required this.downloadLink,
|
required this.downloadLink,
|
||||||
required this.localPath,
|
required this.localPath,
|
||||||
required this.resolution,
|
required this.resolution,
|
||||||
required this.cliffhanger,
|
required this.cliffhanger,
|
||||||
|
required this.settingsChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String downloadLink;
|
String downloadLink;
|
||||||
final String localPath;
|
String localPath;
|
||||||
final String resolution;
|
String resolution;
|
||||||
final int cliffhanger;
|
int cliffhanger;
|
||||||
|
|
||||||
|
final Function(String downloadLink, String localPath, String resolution,
|
||||||
|
int cliffhanger) settingsChanged;
|
||||||
|
|
||||||
|
void downloadLinkChanged(String downloadLink) {
|
||||||
|
this.downloadLink = downloadLink;
|
||||||
|
settingsChanged(downloadLink, localPath, resolution, cliffhanger);
|
||||||
|
}
|
||||||
|
|
||||||
|
void localPathChanged(String localPath) {
|
||||||
|
this.localPath = localPath;
|
||||||
|
settingsChanged(downloadLink, localPath, resolution, cliffhanger);
|
||||||
|
}
|
||||||
|
|
||||||
|
void resolutionChanged(String resolution) {
|
||||||
|
this.resolution = resolution;
|
||||||
|
settingsChanged(downloadLink, localPath, resolution, cliffhanger);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cliffhangerChanged(int cliffhanger) {
|
||||||
|
this.cliffhanger = cliffhanger;
|
||||||
|
settingsChanged(downloadLink, localPath, resolution, cliffhanger);
|
||||||
|
}
|
||||||
|
|
||||||
Widget generateInputs(BuildContext context) {
|
Widget generateInputs(BuildContext context) {
|
||||||
double width = MediaQuery.of(context).size.width;
|
double width = MediaQuery.of(context).size.width;
|
||||||
@@ -34,9 +58,11 @@ class TVShowDetailsSettingsBox extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TVShowDetailsSettingsBoxDownloadLink(
|
TVShowDetailsSettingsBoxDownloadLink(
|
||||||
downloadLink: downloadLink,
|
downloadLink: downloadLink,
|
||||||
|
downloadLinkChanged: downloadLinkChanged,
|
||||||
),
|
),
|
||||||
TVShowDetailsSettingsBoxResolution(
|
TVShowDetailsSettingsBoxResolution(
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
|
resolutionChanged: resolutionChanged,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -44,9 +70,11 @@ class TVShowDetailsSettingsBox extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TVShowDetailsSettingsBoxLocalPath(
|
TVShowDetailsSettingsBoxLocalPath(
|
||||||
localPath: localPath,
|
localPath: localPath,
|
||||||
|
localPathChanged: localPathChanged,
|
||||||
),
|
),
|
||||||
TVShowDetailsSettingsBoxCliffhanger(
|
TVShowDetailsSettingsBoxCliffhanger(
|
||||||
cliffhanger: cliffhanger,
|
cliffhanger: cliffhanger,
|
||||||
|
cliffhangerChanged: cliffhangerChanged,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -66,15 +94,19 @@ class TVShowDetailsSettingsBox extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TVShowDetailsSettingsBoxDownloadLink(
|
TVShowDetailsSettingsBoxDownloadLink(
|
||||||
downloadLink: downloadLink,
|
downloadLink: downloadLink,
|
||||||
|
downloadLinkChanged: downloadLinkChanged,
|
||||||
),
|
),
|
||||||
TVShowDetailsSettingsBoxLocalPath(
|
TVShowDetailsSettingsBoxLocalPath(
|
||||||
localPath: localPath,
|
localPath: localPath,
|
||||||
|
localPathChanged: localPathChanged,
|
||||||
),
|
),
|
||||||
TVShowDetailsSettingsBoxResolution(
|
TVShowDetailsSettingsBoxResolution(
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
|
resolutionChanged: resolutionChanged,
|
||||||
),
|
),
|
||||||
TVShowDetailsSettingsBoxCliffhanger(
|
TVShowDetailsSettingsBoxCliffhanger(
|
||||||
cliffhanger: cliffhanger,
|
cliffhanger: cliffhanger,
|
||||||
|
cliffhangerChanged: cliffhangerChanged,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ class TVShowDetailsSettingsBoxCliffhanger extends StatefulWidget {
|
|||||||
TVShowDetailsSettingsBoxCliffhanger({
|
TVShowDetailsSettingsBoxCliffhanger({
|
||||||
super.key,
|
super.key,
|
||||||
required this.cliffhanger,
|
required this.cliffhanger,
|
||||||
|
required this.cliffhangerChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
int cliffhanger;
|
int cliffhanger;
|
||||||
|
|
||||||
|
final Function(int cliffhanger) cliffhangerChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TVShowDetailsSettingsBoxCliffhanger> createState() =>
|
State<TVShowDetailsSettingsBoxCliffhanger> createState() =>
|
||||||
_TVShowDetailsSettingsBoxCliffhangerState();
|
_TVShowDetailsSettingsBoxCliffhangerState();
|
||||||
@@ -51,6 +54,7 @@ class _TVShowDetailsSettingsBoxCliffhangerState
|
|||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_curCliffhanger = value == true ? 1 : 0;
|
_curCliffhanger = value == true ? 1 : 0;
|
||||||
|
widget.cliffhangerChanged(_curCliffhanger);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,36 +4,41 @@ class TVShowDetailsSettingsBoxDownloadLink extends StatelessWidget {
|
|||||||
const TVShowDetailsSettingsBoxDownloadLink({
|
const TVShowDetailsSettingsBoxDownloadLink({
|
||||||
super.key,
|
super.key,
|
||||||
required this.downloadLink,
|
required this.downloadLink,
|
||||||
|
required this.downloadLinkChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String downloadLink;
|
final String downloadLink;
|
||||||
|
|
||||||
|
final Function(String downloadLink) downloadLinkChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 5.0,
|
left: 5.0,
|
||||||
right: 5.0,
|
right: 5.0,
|
||||||
top: 5.0,
|
top: 5.0,
|
||||||
bottom: 5.0,
|
bottom: 5.0,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text(
|
||||||
'Download Link',
|
'Download Link',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
TextFormField(
|
),
|
||||||
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: 'Download Link',
|
labelText: 'Download Link',
|
||||||
),
|
),
|
||||||
initialValue: downloadLink,
|
initialValue: downloadLink,
|
||||||
),
|
onChanged: (text) {
|
||||||
],
|
downloadLinkChanged(text);
|
||||||
),
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,36 +4,41 @@ class TVShowDetailsSettingsBoxLocalPath extends StatelessWidget {
|
|||||||
const TVShowDetailsSettingsBoxLocalPath({
|
const TVShowDetailsSettingsBoxLocalPath({
|
||||||
super.key,
|
super.key,
|
||||||
required this.localPath,
|
required this.localPath,
|
||||||
|
required this.localPathChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String localPath;
|
final String localPath;
|
||||||
|
|
||||||
|
final Function(String localPath) localPathChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 5.0,
|
left: 5.0,
|
||||||
right: 5.0,
|
right: 5.0,
|
||||||
top: 5.0,
|
top: 5.0,
|
||||||
bottom: 5.0,
|
bottom: 5.0,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text(
|
||||||
'Local Path',
|
'Local Path',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
TextFormField(
|
),
|
||||||
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
labelText: 'Local Path',
|
labelText: 'Local Path',
|
||||||
),
|
),
|
||||||
initialValue: localPath,
|
initialValue: localPath,
|
||||||
),
|
onChanged: (text) {
|
||||||
],
|
localPathChanged(text);
|
||||||
),
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ class TVShowDetailsSettingsBoxResolution extends StatefulWidget {
|
|||||||
TVShowDetailsSettingsBoxResolution({
|
TVShowDetailsSettingsBoxResolution({
|
||||||
super.key,
|
super.key,
|
||||||
required this.resolution,
|
required this.resolution,
|
||||||
|
required this.resolutionChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
String resolution;
|
String resolution;
|
||||||
|
|
||||||
|
final Function(String resolution) resolutionChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TVShowDetailsSettingsBoxResolution> createState() =>
|
State<TVShowDetailsSettingsBoxResolution> createState() =>
|
||||||
_TVShowDetailsSettingsBoxResolutionState();
|
_TVShowDetailsSettingsBoxResolutionState();
|
||||||
@@ -42,38 +45,39 @@ class _TVShowDetailsSettingsBoxResolutionState
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 5.0,
|
left: 5.0,
|
||||||
right: 5.0,
|
right: 5.0,
|
||||||
top: 5.0,
|
top: 5.0,
|
||||||
bottom: 5.0,
|
bottom: 5.0,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text(
|
||||||
'Resolution',
|
'Resolution',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
DropdownButtonFormField(
|
),
|
||||||
decoration: const InputDecoration(
|
DropdownButtonFormField(
|
||||||
border: OutlineInputBorder(),
|
decoration: const InputDecoration(
|
||||||
labelText: 'Resolution',
|
border: OutlineInputBorder(),
|
||||||
),
|
labelText: 'Resolution',
|
||||||
dropdownColor: const Color.fromARGB(255, 127, 127, 127),
|
|
||||||
value: _curResolution,
|
|
||||||
items: resolutions.map((String res) {
|
|
||||||
return DropdownMenuItem(value: res, child: Text(res));
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (String? newValue) {
|
|
||||||
setState(() {
|
|
||||||
_curResolution = newValue!;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
dropdownColor: const Color.fromARGB(255, 127, 127, 127),
|
||||||
),
|
value: _curResolution,
|
||||||
|
items: resolutions.map((String res) {
|
||||||
|
return DropdownMenuItem(value: res, child: Text(res));
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
setState(() {
|
||||||
|
_curResolution = newValue!;
|
||||||
|
widget.resolutionChanged(_curResolution);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|||||||
String? dbHost = prefs.getString('dbHost');
|
String? dbHost = prefs.getString('dbHost');
|
||||||
String? dbPath = prefs.getString('dbPath');
|
String? dbPath = prefs.getString('dbPath');
|
||||||
|
|
||||||
|
dbProtocol = 'https';
|
||||||
|
dbHost = 'api.windesign.at';
|
||||||
|
dbPath = '/multimedia.php';
|
||||||
|
|
||||||
Uri url = Uri(
|
Uri url = Uri(
|
||||||
scheme: dbProtocol,
|
scheme: dbProtocol,
|
||||||
host: dbHost,
|
host: dbHost,
|
||||||
@@ -70,8 +74,9 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TVShow> _tvshows =
|
List<TVShow> _tvshows = await tvshowList
|
||||||
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
.map<TVShow>((json) => TVShow.fromJson(json))
|
||||||
|
.toList();
|
||||||
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
||||||
|
|
||||||
List<EpisodeCount> _episodecount = await episodeList
|
List<EpisodeCount> _episodecount = await episodeList
|
||||||
@@ -90,7 +95,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|||||||
|
|
||||||
return _tvshows;
|
return _tvshows;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print (e.toString());
|
print(e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
Reference in New Issue
Block a user