sustc icon indicating copy to clipboard operation
sustc copied to clipboard

[VideoService] contradicting description about post video

Open Cypher-Bruce opened this issue 2 years ago • 4 comments

Describe your question

In videoRecord.java it says:

    /**
     * The public time of this video, can be null
     */
    private Timestamp publicTime;

Hence, I interpret this as the publicTime can be null and the video with null publicTime is visible once it is reviewed.

However, when benchmarking on videoService#postVideo, I get multiple wrong answers. And I find out that if I simply add a constraint to return null when publicTime is null, I can pass all testcases.

So the question is which description is correct: the one in videoRecord.java (can be null) or the result from benchmark (can't be null)?

Cypher-Bruce avatar Dec 25 '23 09:12 Cypher-Bruce

follow the benchmark...I will edit the doc..

WhatWEat avatar Dec 25 '23 10:12 WhatWEat

@WhatWEat Thank you for your reply. But I have another question, in PostVideoReq.java it says:

/**
     * The video's public time.
     * <p>
     * When posting a video, the owner can decide when to make it public.
     * Before the public time, the video is only visible to the owner and superusers.
     * <p>
     * If the video is already published
     * (when this DTO is used to {@link io.sustc.service.VideoService#updateVideoInfo(AuthInfo, String, PostVideoReq)}
     * update a video), this field should be ignored.
     */
    private Timestamp publicTime;

Does this ignore mean we should not update the publicTime? Then in this case, can publicTime be null? It seems that my answer is wrong if I do as above (if video is published, allow publicTime in PostVideoReq to be null and don't update current publicTime) when benchmarking.

Cypher-Bruce avatar Dec 25 '23 11:12 Cypher-Bruce

That's also my mistakes in doc... But you might get the old version? I have edited the description of publicTime in PostVideoReq.java which means when posting or updating the video, you should provide a exact time(not null and after now()) to make the video public.

    /**
     * The video's public time.
     * <p>
     * When posting a video, the owner can decide when to make it public.
     * Before the public time, the video is only visible to the owner and superusers.
     * <p>
     * This field can't be null.
     */
    private Timestamp publicTime;

WhatWEat avatar Dec 25 '23 12:12 WhatWEat

Thank you for your reply.

Cypher-Bruce avatar Dec 25 '23 12:12 Cypher-Bruce