|
@ -35,7 +35,7 @@ func (srt *srtFileService) QuerySrtFilesByVideoId(videoId string) (srtFiles []en |
|
|
|
|
|
|
|
|
func (srt *srtFileService) QueryOneNotScanVideoIdByRegion(region string) (videoId string, err error) { |
|
|
func (srt *srtFileService) QueryOneNotScanVideoIdByRegion(region string) (videoId string, err error) { |
|
|
var srtFile entity.Srtfile |
|
|
var srtFile entity.Srtfile |
|
|
sqlStr := "SELECT Srtfile.* FROM Srtfile JOIN Videos ON Srtfile.videoId = Videos.videoId JOIN Channel ON Videos.channelId = Channel.channelId WHERE Channel.region = ? and Srtfile.isScan = 0 limit 1;" |
|
|
sqlStr := "SELECT Srtfile.* FROM Srtfile JOIN Channel ON Srtfile.channelId = Channel.channelId WHERE Channel.region = ? and Srtfile.isScan = 0 limit 1;" |
|
|
result := common.MysqlDB.Raw(sqlStr, region).First(&srtFile) |
|
|
result := common.MysqlDB.Raw(sqlStr, region).First(&srtFile) |
|
|
if result.Error != nil { |
|
|
if result.Error != nil { |
|
|
return "", errors.New("no srtFile") |
|
|
return "", errors.New("no srtFile") |
|
|