[mythtv-commits] Ticket #8374: update mythvideo's scan.php to support hash tags
MythTV
mythtv at cvs.mythtv.org
Fri Apr 23 14:25:57 UTC 2010
#8374: update mythvideo's scan.php to support hash tags
-----------------------------------------------+----------------------------
Reporter: Dave Miller <mythtv@…> | Owner: kormoc
Type: patch | Status: infoneeded_new
Priority: minor | Milestone: unknown
Component: Plugin - MythWeb | Version: Trunk Head
Severity: medium | Mlocked: 0
-----------------------------------------------+----------------------------
Comment(by Dave Miller <mythtv@…>):
Replying to [comment:1 anonymous]:
> Or just shoving it in a string and formatting it that way? There doesn't
look like there's any reason it requires all the math if it's just
concatting them and outputting as a hex value
It's not a matter of formatting it, it's a matter of calculating it to
begin with. It's not a pair of crc32s concatenated to each other, it's a
64-bit checksum of the first and last megabyte of the file. You take the
first and last megabyte of the file 64 bits at a time and add it together,
ignoring any carry on each addition. *if* your PHP does 64-bit ints
(which it apparently only does if running on a 64-bit OS) it only does
signed ints, which means the addition breaks when you go over 63 bits.
The BCMath stuff looks like it'd probably solve this, however it's
completely unnecessary because...
Replying to [comment:2 robertm]:
> You can perform hashes using the Myth protocol, this is the preferred
way to do it (and should only take a couple lines of code instead of
large-ish changes like this).
Asking the backend to do it for us indeed sounds like a much better way.
"largish" changes like this patch would still be needed (it's not as large
as it looks, the code's being reordered, not massively changed) it just
won't need the extra python file.
Browsing through the Myth protocol, it doesn't look like it'll do the
actual database update for us yet, but it *will* let us do the file
search, which can also replace the call out to the unix 'find' command,
thus eliminating both shell execs. Not only that but it'll relay to
secondary backends if they're accessible, removing the need to limit
ourselves to storage groups that reside on the backend we're running on.
The only downside is our find command on the local filesystem gives us the
entire tree in one shot, where the directory listing generated by the Myth
protocol only gives us the current directory, so we'll have to recurse it
ourselves and repeat calls to the backend server to get each of the
subdirectories and so forth. I like the idea of being able to scan all of
the backends and not just the one we're running on. (Heck, maybe mythweb
doesn't even need to be running on the backend anymore, and will still
work that way!)
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/8374#comment:3>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list