mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web): show partners assets on the main timeline (#4933)
This commit is contained in:
parent
3b11854702
commit
35767591d2
59 changed files with 1929 additions and 172 deletions
|
|
@ -32,38 +32,43 @@ const UserSchema = CollectionSchema(
|
|||
name: r'id',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'isAdmin': PropertySchema(
|
||||
r'inTimeline': PropertySchema(
|
||||
id: 3,
|
||||
name: r'inTimeline',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isAdmin': PropertySchema(
|
||||
id: 4,
|
||||
name: r'isAdmin',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isPartnerSharedBy': PropertySchema(
|
||||
id: 4,
|
||||
id: 5,
|
||||
name: r'isPartnerSharedBy',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isPartnerSharedWith': PropertySchema(
|
||||
id: 5,
|
||||
id: 6,
|
||||
name: r'isPartnerSharedWith',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'lastName': PropertySchema(
|
||||
id: 6,
|
||||
id: 7,
|
||||
name: r'lastName',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'memoryEnabled': PropertySchema(
|
||||
id: 7,
|
||||
id: 8,
|
||||
name: r'memoryEnabled',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'profileImagePath': PropertySchema(
|
||||
id: 8,
|
||||
id: 9,
|
||||
name: r'profileImagePath',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'updatedAt': PropertySchema(
|
||||
id: 9,
|
||||
id: 10,
|
||||
name: r'updatedAt',
|
||||
type: IsarType.dateTime,
|
||||
)
|
||||
|
|
@ -134,13 +139,14 @@ void _userSerialize(
|
|||
writer.writeString(offsets[0], object.email);
|
||||
writer.writeString(offsets[1], object.firstName);
|
||||
writer.writeString(offsets[2], object.id);
|
||||
writer.writeBool(offsets[3], object.isAdmin);
|
||||
writer.writeBool(offsets[4], object.isPartnerSharedBy);
|
||||
writer.writeBool(offsets[5], object.isPartnerSharedWith);
|
||||
writer.writeString(offsets[6], object.lastName);
|
||||
writer.writeBool(offsets[7], object.memoryEnabled);
|
||||
writer.writeString(offsets[8], object.profileImagePath);
|
||||
writer.writeDateTime(offsets[9], object.updatedAt);
|
||||
writer.writeBool(offsets[3], object.inTimeline);
|
||||
writer.writeBool(offsets[4], object.isAdmin);
|
||||
writer.writeBool(offsets[5], object.isPartnerSharedBy);
|
||||
writer.writeBool(offsets[6], object.isPartnerSharedWith);
|
||||
writer.writeString(offsets[7], object.lastName);
|
||||
writer.writeBool(offsets[8], object.memoryEnabled);
|
||||
writer.writeString(offsets[9], object.profileImagePath);
|
||||
writer.writeDateTime(offsets[10], object.updatedAt);
|
||||
}
|
||||
|
||||
User _userDeserialize(
|
||||
|
|
@ -153,13 +159,14 @@ User _userDeserialize(
|
|||
email: reader.readString(offsets[0]),
|
||||
firstName: reader.readString(offsets[1]),
|
||||
id: reader.readString(offsets[2]),
|
||||
isAdmin: reader.readBool(offsets[3]),
|
||||
isPartnerSharedBy: reader.readBoolOrNull(offsets[4]) ?? false,
|
||||
isPartnerSharedWith: reader.readBoolOrNull(offsets[5]) ?? false,
|
||||
lastName: reader.readString(offsets[6]),
|
||||
memoryEnabled: reader.readBoolOrNull(offsets[7]),
|
||||
profileImagePath: reader.readStringOrNull(offsets[8]) ?? '',
|
||||
updatedAt: reader.readDateTime(offsets[9]),
|
||||
inTimeline: reader.readBoolOrNull(offsets[3]),
|
||||
isAdmin: reader.readBool(offsets[4]),
|
||||
isPartnerSharedBy: reader.readBoolOrNull(offsets[5]) ?? false,
|
||||
isPartnerSharedWith: reader.readBoolOrNull(offsets[6]) ?? false,
|
||||
lastName: reader.readString(offsets[7]),
|
||||
memoryEnabled: reader.readBoolOrNull(offsets[8]),
|
||||
profileImagePath: reader.readStringOrNull(offsets[9]) ?? '',
|
||||
updatedAt: reader.readDateTime(offsets[10]),
|
||||
);
|
||||
return object;
|
||||
}
|
||||
|
|
@ -178,18 +185,20 @@ P _userDeserializeProp<P>(
|
|||
case 2:
|
||||
return (reader.readString(offset)) as P;
|
||||
case 3:
|
||||
return (reader.readBool(offset)) as P;
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 4:
|
||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 5:
|
||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||
case 6:
|
||||
return (reader.readString(offset)) as P;
|
||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||
case 7:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
return (reader.readString(offset)) as P;
|
||||
case 8:
|
||||
return (reader.readStringOrNull(offset) ?? '') as P;
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 9:
|
||||
return (reader.readStringOrNull(offset) ?? '') as P;
|
||||
case 10:
|
||||
return (reader.readDateTime(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
|
|
@ -769,6 +778,32 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterFilterCondition> inTimelineIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'inTimeline',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterFilterCondition> inTimelineIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'inTimeline',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterFilterCondition> inTimelineEqualTo(
|
||||
bool? value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'inTimeline',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterFilterCondition> isAdminEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
|
|
@ -1341,6 +1376,18 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> sortByInTimeline() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'inTimeline', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> sortByInTimelineDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'inTimeline', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> sortByIsAdmin() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isAdmin', Sort.asc);
|
||||
|
|
@ -1463,6 +1510,18 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> thenByInTimeline() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'inTimeline', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> thenByInTimelineDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'inTimeline', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QAfterSortBy> thenByIsAdmin() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isAdmin', Sort.asc);
|
||||
|
|
@ -1582,6 +1641,12 @@ extension UserQueryWhereDistinct on QueryBuilder<User, User, QDistinct> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QDistinct> distinctByInTimeline() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'inTimeline');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, User, QDistinct> distinctByIsAdmin() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'isAdmin');
|
||||
|
|
@ -1653,6 +1718,12 @@ extension UserQueryProperty on QueryBuilder<User, User, QQueryProperty> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, bool?, QQueryOperations> inTimelineProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'inTimeline');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<User, bool, QQueryOperations> isAdminProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'isAdmin');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue