import 'package:aves/model/entry/entry.dart';
import 'package:aves/model/entry/origins.dart';
import 'package:aves/remote/remote_origin.dart';

extension RemoteFlags on AvesEntry {
  /// Entry salvata come remota nel DB
  bool get isRemoteOnly => origin == RemoteOrigin.value;

  /// Ha collegamento remoto (almeno remoteId valido)
  bool get isRemoteAvailable => (remoteId != null && remoteId!.trim().isNotEmpty);

  /// “Ibrido”: entry locale (origin=mediaStoreContent) con remote link
  /// (la vuoi trattare come locale in UI/performance)
  bool get isLocalAndRemote =>
      origin == EntryOrigins.mediaStoreContent && isRemoteAvailable;
}
