[Feature] Youtube importing and refreshing implementation (ytdlp) #1

Merged
bivashy merged 5 commits from feature/youtube-import-impl into main 2026-01-07 22:56:37 +00:00
34 changed files with 986 additions and 360 deletions
Showing only changes of commit 84d881b5ce - Show all commits

View File

@ -1,5 +1,7 @@
package com.bivashy.backend.composer.dto.importing; package com.bivashy.backend.composer.dto.importing;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
@ -9,20 +11,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
@JsonSubTypes.Type(value = SingleTrackProgress.class, name = "TRACK"), @JsonSubTypes.Type(value = SingleTrackProgress.class, name = "TRACK"),
}) })
public abstract class BaseTrackProgress { public abstract class BaseTrackProgress {
protected UUID id;
protected long playlistId; protected long playlistId;
protected long trackSourceId; protected long trackSourceId;
protected long userId; protected long userId;
protected long timestamp; protected long timestamp;
private String type; private ProgressEntryType type;
public BaseTrackProgress(long playlistId, long trackSourceId, long userId) { public BaseTrackProgress(long playlistId, long trackSourceId, long userId) {
this.id = UUID.randomUUID();
this.playlistId = playlistId; this.playlistId = playlistId;
this.trackSourceId = trackSourceId; this.trackSourceId = trackSourceId;
this.userId = userId; this.userId = userId;
this.timestamp = System.currentTimeMillis(); this.timestamp = System.currentTimeMillis();
} }
public UUID getId() {
return id;
}
public Long getTimestamp() { public Long getTimestamp() {
return timestamp; return timestamp;
} }
@ -31,7 +39,7 @@ public abstract class BaseTrackProgress {
return userId; return userId;
} }
public String getType() { public ProgressEntryType getType() {
return type; return type;
} }
@ -44,7 +52,7 @@ public abstract class BaseTrackProgress {
} }
protected void setType(ProgressEntryType type) { protected void setType(ProgressEntryType type) {
this.type = type.name(); this.type = type;
} }
} }