[mythtv] (NEW) patch for mythVideo to use already scanned coverfile
Dave Alden
alden at math.ohio-state.edu
Sat Jul 19 12:14:36 EDT 2003
Hi,
On Fri, Jul 18, 2003 at 03:29:24PM -0400, James Y. Knight wrote:
> Using dot files for that is gross. If you're worried about stat'ing
> multiple files to find the one with the right extension, why not simply
> make it people use an extension of ".cover" no matter what the file
> format the image is.
> aka "the rookie.avi.cover".
The only problem with this is that I'd have to modify mythvideo to ignore
files that end in ".cover" -- I'm not comfortable with doing that (what if
someone named their movie "duck.and.cover" :-).
Since no one else spoke up, I've gone with the dotfile approach. All you
need to do is to put the coverfile in the same directory as the movie and
call it ".<moviefilename>". The patch is attached. :-)
...dave
-------------- next part --------------
Index: videomanager.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videomanager.cpp,v
retrieving revision 1.7
diff -u -r1.7 videomanager.cpp
--- videomanager.cpp 16 Jun 2003 16:16:19 -0000 1.7
+++ videomanager.cpp 19 Jul 2003 15:08:01 -0000
@@ -282,6 +282,17 @@
QString VideoManager::GetMoviePoster(QString movieNum)
{
+ QString coverFile = curitem->Filename();
+
+ coverFile = coverFile.left(coverFile.findRev("/")) + "/." + coverFile.right(coverFile.length() - coverFile.findRev("/") - 1);
+
+ QFile checkFile(coverFile);
+
+ if (checkFile.exists())
+ {
+ return coverFile;
+ }
+
QString host = "www.imdb.com";
QUrl url("http://" + host + "/Posters?" + movieNum
More information about the mythtv-dev
mailing list