addactor, addtag dialogs
This commit is contained in:
12
lib/api/actor_api.dart
Normal file
12
lib/api/actor_api.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../types/actor.dart';
|
||||
import 'api.dart';
|
||||
|
||||
Future<List<Actor>> loadAllActors() async {
|
||||
final data = await API.query("actor", "getAllActors", {});
|
||||
|
||||
final d = (jsonDecode(data) ?? []) as List<dynamic>;
|
||||
final actors = d.map((e) => Actor.fromJson(e)).toList(growable: false);
|
||||
return actors;
|
||||
}
|
12
lib/api/video_api.dart
Normal file
12
lib/api/video_api.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../types/video_data.dart';
|
||||
import 'api.dart';
|
||||
|
||||
Future<VideoData> loadVideoData(int videoId) async {
|
||||
final data = await API.query("video", "loadVideo", {'MovieId': videoId});
|
||||
|
||||
final d = jsonDecode(data);
|
||||
final video = VideoData.fromJson(d);
|
||||
return video;
|
||||
}
|
Reference in New Issue
Block a user