Anilist tracking, metadata fetching, and media status update #38
+2
-2
@@ -10,8 +10,8 @@ identifier_name:
|
||||
min_length: 1
|
||||
allowed_symbols: ["_"]
|
||||
file_length:
|
||||
error: 10000
|
||||
warning: 3000
|
||||
error: 100000
|
||||
warning: 10000
|
||||
cyclomatic_complexity:
|
||||
warning: 50
|
||||
error: 100
|
||||
|
||||
+1046
-165
File diff suppressed because it is too large
Load Diff
@@ -49,17 +49,18 @@ table VolumeMetadata {
|
||||
|
||||
table Metadata {
|
||||
title:string (required);
|
||||
format:Format;
|
||||
format:Format = null;
|
||||
original_language:string;
|
||||
country_of_origin:string;
|
||||
publication_demographic:PublicationDemographic;
|
||||
status:Status;
|
||||
content_rating:ContentRating;
|
||||
source:Source;
|
||||
publication_demographic:PublicationDemographic = null;
|
||||
status:Status = null;
|
||||
content_rating:ContentRating = null;
|
||||
source:Source = null;
|
||||
start_release_date:Date;
|
||||
end_release_date:Date;
|
||||
tags:[Tag];
|
||||
description:string;
|
||||
anilist_id:uint = null;
|
||||
volumes:[VolumeMetadata];
|
||||
image_count:uint;
|
||||
}
|
||||
|
||||
@@ -448,21 +448,22 @@ public struct Metadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifia
|
||||
static let endReleaseDate: VOffset = 22
|
||||
static let tags: VOffset = 24
|
||||
static let description: VOffset = 26
|
||||
static let volumes: VOffset = 28
|
||||
static let imageCount: VOffset = 30
|
||||
static let anilistId: VOffset = 28
|
||||
static let volumes: VOffset = 30
|
||||
static let imageCount: VOffset = 32
|
||||
}
|
||||
|
||||
public var title: String! { let o = _accessor.offset(VT.title); return _accessor.string(at: o) }
|
||||
public var titleSegmentArray: [UInt8]! { return _accessor.getVector(at: VT.title) }
|
||||
public var format: Format { let o = _accessor.offset(VT.format); return o == 0 ? .manga : Format(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .manga }
|
||||
public var format: Format? { let o = _accessor.offset(VT.format); return o == 0 ? nil : Format(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? nil }
|
||||
public var originalLanguage: String? { let o = _accessor.offset(VT.originalLanguage); return o == 0 ? nil : _accessor.string(at: o) }
|
||||
public var originalLanguageSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.originalLanguage) }
|
||||
public var countryOfOrigin: String? { let o = _accessor.offset(VT.countryOfOrigin); return o == 0 ? nil : _accessor.string(at: o) }
|
||||
public var countryOfOriginSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.countryOfOrigin) }
|
||||
public var publicationDemographic: PublicationDemographic { let o = _accessor.offset(VT.publicationDemographic); return o == 0 ? .shounen : PublicationDemographic(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .shounen }
|
||||
public var status: Status { let o = _accessor.offset(VT.status); return o == 0 ? .finished : Status(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .finished }
|
||||
public var contentRating: ContentRating { let o = _accessor.offset(VT.contentRating); return o == 0 ? .safe : ContentRating(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .safe }
|
||||
public var source: Source { let o = _accessor.offset(VT.source); return o == 0 ? .original : Source(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .original }
|
||||
public var publicationDemographic: PublicationDemographic? { let o = _accessor.offset(VT.publicationDemographic); return o == 0 ? nil : PublicationDemographic(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? nil }
|
||||
public var status: Status? { let o = _accessor.offset(VT.status); return o == 0 ? nil : Status(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? nil }
|
||||
public var contentRating: ContentRating? { let o = _accessor.offset(VT.contentRating); return o == 0 ? nil : ContentRating(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? nil }
|
||||
public var source: Source? { let o = _accessor.offset(VT.source); return o == 0 ? nil : Source(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? nil }
|
||||
public var startReleaseDate: Date? { let o = _accessor.offset(VT.startReleaseDate); return o == 0 ? nil : _accessor.readBuffer(of: Date.self, at: o) }
|
||||
public var mutableStartReleaseDate: Date_Mutable? { let o = _accessor.offset(VT.startReleaseDate); return o == 0 ? nil : Date_Mutable(_accessor.bb, o: o + _accessor.position) }
|
||||
public var endReleaseDate: Date? { let o = _accessor.offset(VT.endReleaseDate); return o == 0 ? nil : _accessor.readBuffer(of: Date.self, at: o) }
|
||||
@@ -470,38 +471,41 @@ public struct Metadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifia
|
||||
public var tags: FlatbufferVector<Tag> { return _accessor.vector(at: VT.tags, byteSize: 4) }
|
||||
public var description: String? { let o = _accessor.offset(VT.description); return o == 0 ? nil : _accessor.string(at: o) }
|
||||
public var descriptionSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.description) }
|
||||
public var anilistId: UInt32? { let o = _accessor.offset(VT.anilistId); return o == 0 ? nil : _accessor.readBuffer(of: UInt32.self, at: o) }
|
||||
public var volumes: FlatbufferVector<VolumeMetadata> { return _accessor.vector(at: VT.volumes, byteSize: 4) }
|
||||
public var imageCount: UInt32 { let o = _accessor.offset(VT.imageCount); return o == 0 ? 0 : _accessor.readBuffer(of: UInt32.self, at: o) }
|
||||
public static func startMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 14) }
|
||||
public static func startMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 15) }
|
||||
public static func add(title: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: title, at: VT.title) }
|
||||
public static func add(format: Format, _ fbb: inout FlatBufferBuilder) { fbb.add(element: format.rawValue, def: 0, at: VT.format) }
|
||||
public static func add(format: Format?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: format?.rawValue, at: VT.format) }
|
||||
public static func add(originalLanguage: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: originalLanguage, at: VT.originalLanguage) }
|
||||
public static func add(countryOfOrigin: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: countryOfOrigin, at: VT.countryOfOrigin) }
|
||||
public static func add(publicationDemographic: PublicationDemographic, _ fbb: inout FlatBufferBuilder) { fbb.add(element: publicationDemographic.rawValue, def: 0, at: VT.publicationDemographic) }
|
||||
public static func add(status: Status, _ fbb: inout FlatBufferBuilder) { fbb.add(element: status.rawValue, def: 0, at: VT.status) }
|
||||
public static func add(contentRating: ContentRating, _ fbb: inout FlatBufferBuilder) { fbb.add(element: contentRating.rawValue, def: 0, at: VT.contentRating) }
|
||||
public static func add(source: Source, _ fbb: inout FlatBufferBuilder) { fbb.add(element: source.rawValue, def: 0, at: VT.source) }
|
||||
public static func add(publicationDemographic: PublicationDemographic?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: publicationDemographic?.rawValue, at: VT.publicationDemographic) }
|
||||
public static func add(status: Status?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: status?.rawValue, at: VT.status) }
|
||||
public static func add(contentRating: ContentRating?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: contentRating?.rawValue, at: VT.contentRating) }
|
||||
public static func add(source: Source?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: source?.rawValue, at: VT.source) }
|
||||
public static func add(startReleaseDate: Date?, _ fbb: inout FlatBufferBuilder) { guard let startReleaseDate = startReleaseDate else { return }; fbb.create(struct: startReleaseDate, position: VT.startReleaseDate) }
|
||||
public static func add(endReleaseDate: Date?, _ fbb: inout FlatBufferBuilder) { guard let endReleaseDate = endReleaseDate else { return }; fbb.create(struct: endReleaseDate, position: VT.endReleaseDate) }
|
||||
public static func addVectorOf(tags: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: tags, at: VT.tags) }
|
||||
public static func add(description: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: description, at: VT.description) }
|
||||
public static func add(anilistId: UInt32?, _ fbb: inout FlatBufferBuilder) { fbb.add(element: anilistId, at: VT.anilistId) }
|
||||
public static func addVectorOf(volumes: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: volumes, at: VT.volumes) }
|
||||
public static func add(imageCount: UInt32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: imageCount, def: 0, at: VT.imageCount) }
|
||||
public static func endMetadata(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [4]); return end }
|
||||
public static func createMetadata(
|
||||
_ fbb: inout FlatBufferBuilder,
|
||||
titleOffset title: Offset,
|
||||
format: Format = .manga,
|
||||
format: Format? = nil,
|
||||
originalLanguageOffset originalLanguage: Offset = Offset(),
|
||||
countryOfOriginOffset countryOfOrigin: Offset = Offset(),
|
||||
publicationDemographic: PublicationDemographic = .shounen,
|
||||
status: Status = .finished,
|
||||
contentRating: ContentRating = .safe,
|
||||
source: Source = .original,
|
||||
publicationDemographic: PublicationDemographic? = nil,
|
||||
status: Status? = nil,
|
||||
contentRating: ContentRating? = nil,
|
||||
source: Source? = nil,
|
||||
startReleaseDate: Date? = nil,
|
||||
endReleaseDate: Date? = nil,
|
||||
tagsVectorOffset tags: Offset = Offset(),
|
||||
descriptionOffset description: Offset = Offset(),
|
||||
anilistId: UInt32? = nil,
|
||||
volumesVectorOffset volumes: Offset = Offset(),
|
||||
imageCount: UInt32 = 0
|
||||
) -> Offset {
|
||||
@@ -518,6 +522,7 @@ public struct Metadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifia
|
||||
Metadata.add(endReleaseDate: endReleaseDate, &fbb)
|
||||
Metadata.addVectorOf(tags: tags, &fbb)
|
||||
Metadata.add(description: description, &fbb)
|
||||
Metadata.add(anilistId: anilistId, &fbb)
|
||||
Metadata.addVectorOf(volumes: volumes, &fbb)
|
||||
Metadata.add(imageCount: imageCount, &fbb)
|
||||
return Metadata.endMetadata(&fbb, start: __start)
|
||||
@@ -537,6 +542,7 @@ public struct Metadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifia
|
||||
try _v.visit(field: VT.endReleaseDate, fieldName: "endReleaseDate", required: false, type: Date.self)
|
||||
try _v.visit(field: VT.tags, fieldName: "tags", required: false, type: ForwardOffset<Vector<ForwardOffset<Tag>, Tag>>.self)
|
||||
try _v.visit(field: VT.description, fieldName: "description", required: false, type: ForwardOffset<String>.self)
|
||||
try _v.visit(field: VT.anilistId, fieldName: "anilistId", required: false, type: UInt32.self)
|
||||
try _v.visit(field: VT.volumes, fieldName: "volumes", required: false, type: ForwardOffset<Vector<ForwardOffset<VolumeMetadata>, VolumeMetadata>>.self)
|
||||
try _v.visit(field: VT.imageCount, fieldName: "imageCount", required: false, type: UInt32.self)
|
||||
_v.finish()
|
||||
|
||||
Reference in New Issue
Block a user