Skip to content

Commit

Permalink
fix: restore previous *Metadata constructors
Browse files Browse the repository at this point in the history
To not introduce a breaking chage
  • Loading branch information
wzieba committed Jan 23, 2024
1 parent c695bcc commit 8996f50
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@ public ParselyMetadata(
this.pageType = pageType;
}

public ParselyMetadata(
@Nullable ArrayList<String> authors,
@Nullable String link,
@Nullable String section,
@Nullable ArrayList<String> tags,
@Nullable String thumbUrl,
@Nullable String title,
@Nullable Calendar pubDate
) {
this.authors = authors;
this.link = link;
this.section = section;
this.tags = tags;
this.thumbUrl = thumbUrl;
this.title = title;
this.pubDate = pubDate;
this.pageType = null;
}

/**
* Turn this object into a Map
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ public ParselyVideoMetadata(
this.durationSeconds = durationSeconds;
}

public ParselyVideoMetadata(
@Nullable ArrayList<String> authors,
@NonNull String videoId,
@Nullable String section,
@Nullable ArrayList<String> tags,
@Nullable String thumbUrl,
@Nullable String title,
@Nullable Calendar pubDate,
@NonNull int durationSeconds
) {
super(authors, videoId, section, tags, thumbUrl, title, pubDate, null);
if (videoId == null) {
throw new NullPointerException("videoId cannot be null");
}
this.durationSeconds = durationSeconds;
}

/**
* Turn this object into a Map
*
Expand Down

0 comments on commit 8996f50

Please sign in to comment.