[mythtv] mythrecipe

Chris Petersen lists at forevermore.net
Tue Nov 9 17:56:24 UTC 2004

> Ok, id is just a unique id for this item but what is parent_id?

It was my intention to set the ingredients up as a tree of their own.
So you could browse them my family:

Sweeteners -> Sugar -> Sucanat
Fruit -> Apple -> Granny Smith

Keep in mind that "ingredients" are not "recipe ingredients".  Off-hand,
I'd say that description is a list-summary, and text is a wiki-markup
full detail for the ingredient.

> Also have you looked at the nutritional value aspect of it? I really
>  like that feature in recipezaar but I can only imagine how 
> complicated it would be. I did a quick search and found the USDA 
> Nutrient Database for Standard Reference here: 
> http://www.nal.usda.gov/fnic/foodcomp/Data/SR17/sr17.html This is how
>  recipezaar calculates there information: 
> http://www.recipezaar.com/help/nutrition.zsp However like they say, 
> this is still just an approximation and there are some things that 
> will trip it up but I like the idea of implementing something like 
> this.

Yup, it's always been part of my plan to do this.  I'd also like to get
a weight-watchers-esque point system added.  my wife knows the formula
they use, and I figured it'd be cool to add in for those people who need
to watch their weight (won't get into the diet war, but weight watchers
is probably the only "good" commercial diet system out there)

> Ok, I think the first priority should be to get your web based 
> version setup and then once that is up and running we can start to 
> look into interfacing it with mythtv.

One doesn't require the other, but it would be best to use the php stuff
to get the structures laid out, since php is a lot faster to develop
with than C++.

>> Basically, each category is a node.  There is one parent node, and
>>  when you create a new node, you tell it where its parent is.  Easy
>>  to do, and you can do some magic to make multi-homed categories, 
>> it's pretty cool.
> Ok, so like a linked list?

Yup, pretty much like a linked list.

> So in your recipe table you want to use the ingredient field to store
>  ingredients in a list? (Kindof like how mythmusic stores music ids 
> in it's playlists)

No, the text field for "ingredients" was originally added to store the
original hand-entered ingredient list -- I don't know if I would keep it
around or not, but at the time I wrote up the tables I thought it was a
good idea.  When a recipe is saved, this text is then parsed out into
the recipe_ingredients table (which is incomplete).

> Also maybe if I have time I will look into mysql's innoDB type and 
> see how to set it up because it seems they are working in fun 
> features like "on delete cascade" and other transactional stuff.

innodb is easy:


but keep in mind that MyISAM tables are WAY WAY faster.

> So how exactly do you want to do this? Search on keywords and then 
> map certain keywords to a category? If we do the linked list idea for
>  categores we could use another lookup table that would just store 
> the parent node and the recipe. That would allow for an unlimited 
> ammount of categories per recipe. It would also allow you to setup 
> your categories however you want.

I came up with the idea of using keywords over assigning categories as a
way to avoid the tedious task of assigning items to categories.  The
idea is that organisation should my dynamic and fluid, and it allows
people to create things that may not yet have a category.  When a
category is created, or a keyword attached to that category, the item
instantly becomes visible and falls into place.  It's also a LOT easier
for non-geeks to think in terms of keywords.

The idea is that you create a category tree (table 1) and recipes (table
2), and then attach keywords to each category (table 3) and recipe
(table 4).

You could go even further and create a dynamic category list, but it 
would risk creating something that the average user might have a hard 
time following.

> Understandable, thanks for your help in all of this, you've figured 
> out some things that were a stumbling block for me before.

I design this kind of thing for a living, so I put a lot of thought into it.

> I also noticed in your sql directory you have brew.sql that looks 
> suspiciously like homebrewing stuff ;-) You homebrew I assume then?

You obviously don't hang out on #mythtv-users.  Beirdo and I are usually
talking about brewing (well, vintning) instead of mythtv.  I don't do 
beer (too much work, and I'm too picky about it), but mead and cider are 

> Perhaps we could eventuall tack on a brewing recipe/calculator addon 
> to the web page. I myself am saving and eventually planning on 
> jumping into an all grain setup. However that will be after the 
> house. ;-) 

the brewing thing will probably be a plugin for my cooktools stuff 
(still need a better name).  I've lost track of time too many times, and 
need something to remind me when to do certain things to the brew. 
Since it's not much harder to add stuff like alcohol percentage 
calculations, I plan to add that in, too.


More information about the mythtv-dev mailing list