fix bug with podcastify attachment

it was making a file, same name as destination.
This is why we oop!
This commit is contained in:
Adam R Grey 2023-04-10 23:20:07 -04:00
parent 3d84beb640
commit 7e6b0fbc40

View File

@ -55,24 +55,21 @@ namespace ttrss_co_client.tasks
var toReturn = new WorkOrder() var toReturn = new WorkOrder()
{ {
articleId = headline.id,//<-- that way later tasks can update the note articleId = headline.id,
Phase2TaskList = new Dictionary<int, string>(), Phase2TaskList = new Dictionary<int, string>(),
data = new Dictionary<string, string>(), data = new Dictionary<string, string>(),
guid = Guid.Parse(myGuid) guid = Guid.Parse(myGuid)
}; };
toReturn.data["path"] = downloadPath; toReturn.data["path"] = downloadPath;
toReturn.Phase2TaskList[1] = "filemovePublish"; toReturn.Phase2TaskList[1] = "filemovePublish";
toReturn.data["publish-target"] = $"{Conf.OnDoneCopy}/Podcasts/{podcastTitle}/{Path.GetFileName(downloadPath)}"; toReturn.data["publish-target"] = $"{Conf.OnDoneCopy}/Podcasts/{podcastTitle}/";
if(extensionUpstream != ".mp3") if(extensionUpstream != ".mp3")
{ {
Console.WriteLine($"{headline.title} needs conversion task."); Console.WriteLine($"{headline.title} needs conversion task.");
toReturn.Phase2TaskList[0] = "convert"; toReturn.Phase2TaskList[0] = "convert";
toReturn.data["conversion-target"] = downloadPath.Substring(0, downloadPath.LastIndexOf('.')) + ".mp3"; toReturn.data["conversion-target"] = ".mp3";
toReturn.data["publish-target"] = $"{Conf.OnDoneCopy}/Podcasts/{podcastTitle}/{Path.GetFileName(toReturn.data["conversion-target"])}";
} }
return toReturn; return toReturn;
} }
} }