getStudioById method

  1. @override
Future<Studio> getStudioById(
  1. String id
)
override

Implementation

@override
Future<Studio> getStudioById(String id) async {
  final result = await client.query$FindStudio(
    Options$Query$FindStudio(variables: Variables$Query$FindStudio(id: id)),
  );

  if (result.hasException) throw result.exception!;
  final s = result.parsedData!.findStudio;
  if (s == null) throw StateError('Studio not found');

  return Studio(
    id: s.id,
    name: s.name,
    url: s.url,
    imagePath: s.image_path,
    details: s.details,
    rating100: s.rating100,
    sceneCount: s.scene_count,
    imageCount: s.image_count,
    galleryCount: s.gallery_count,
    performerCount: s.performer_count,
    favorite: s.favorite,
  );
}