getMedia method

Future<CloudMediaItem> getMedia(
  1. String mediaId
)

Fetch a single media item by mediaId.

Throws CloudMediaNotFoundException if the item does not exist.

Implementation

Future<CloudMediaItem> getMedia(String mediaId) async {
  final doc =
      await _firestore.doc(FirestorePaths.mediaDoc(_uid, mediaId)).get();
  if (!doc.exists) throw CloudMediaNotFoundException('Not found: $mediaId');
  return CloudMediaItem.fromFirestore(doc);
}